0

I'm building a web application that needs to send notifications by SMS. As ColdFusion itself provides an SMS Service, can I use the same for sending SMS without using any 3rd party SMS Gateway Service like Clickatell?

I have found some information at Ben Nadel's website but it is not working, Sending Text Messages (SMS) With ColdFusion And CFMail

I have tried the following code,

<cfmail to="9567102323@ideacellular.net" from="9567102323" subject="New Message" type="text">
    <cfmailpart  type="text/plain">Hello huan, this is a test message</cfmailpart>
</cfmail>
lambypie
  • 471
  • 1
  • 12
  • 35
  • 4
    What you have tried has nothing to do with using an SMS service. Your code is just sending an email. Which I suppose is fine assuming you know all of the carrier's email services that convert email to text. So how did your code not work? You gave no details. Did it throw an error? First begin by confirming that you can send an email to `9567102323@ideacellular.net` and receive a text. Once you get that working and know the correct email address for sending then try using ColdFusion. From your example my guess would be that it failed because you did not supply a properly format `from` address. – Miguel-F Sep 12 '14 at 12:23
  • 1
    In fairness to @lambypie, the reference he is using gives me the impression that the mail gets sent from a phone number. – Dan Bracuk Sep 12 '14 at 13:32
  • 1
    I have successfully sent text messages like this in the past. As a baseline, you may want to try sending an email to `9567102323@ideacellular.net` via your normal email client (like Gmail) and see if it shows up as a text message. – Brian FitzGerald Sep 12 '14 at 13:47

2 Answers2

1

As guessed by Miguel in the comments, your code will not give the desired result because the from attribute of your cfmail tag is not a valid email address. Your ColdFusion code will execute without error but the mail will not be sent. The mail file will appear in the Undelivr folder of a path resembling this: yourlocalsystem\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\Mail.

For the code in your question, add "@ideacellular.net" to the from attribute of your cfmail tag. From here, I'm a little uncertain. If that mail goes to the Undelivr folder it might have something to do with your mail server only being able to send mail from certain domains. I have vague recollections of stuff like that happening to me.

Dan Bracuk
  • 20,699
  • 4
  • 26
  • 43
1

You can't send SMS direct from ColdFusion, does not have this capability, just like ColdFusion does not have a built-in mail server. cfmail tag makes it easy to communicate with a mail server, but it does not send emails itself.

Regarding SMS, ColdFusion makes it easy to work with SMS gateways, look at CF docs for "SMS Event Gateway" and sendGatewayMessage().

Alex Baban
  • 11,312
  • 4
  • 30
  • 44