943,483 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Unsolved
  • Views: 66494
  • ColdFusion RSS
You are currently viewing page 1 of this multi-page discussion thread
Jan 1st, 2005
0

Send a text message to your phone from your site!

Expand Post »
A Brief History

I like to call this my instant call back feature. Basically I knew that you can send a text message to your phone through email. So I said to myself, "self, why not send yourself the text message through a web form through some type of sendmail script!". So that is how I came up with this little script several years ago, it has been my little secret ever since. I use it on my Real Estate Web Site program, where I build web sites for real estate agents. Basically I label "Instant Call Back Feature", to imply that as soon as they enter the information, the real estate agent will call them instantly. The user fills out the form and then a text message is sent to the web site owners phone alerting them that they had a web site visitor that wants them to call them. I have only seen a handfull of people on the net think of it as well and implement their own variations, but today I decided to teach you!

Examples of Potential Script Use!

- instant call feature
- alert web site owner of a sale
- send personal messages
- alert web site owner they are out of inventory

How to send text messages to your phone via email

ussually your email for text messaging is your phone number w/areacode (without spaces) @ your provider.com You will have to go to your providers web site and look it up.

Here are some examples I know;

4075551212 {@} messaging.sprintpcs.com (sprint pcs)
4075551212 {@} tmomail.net (T mobile)
4075551212 {@} vtext.com (Verizon)

The Tutorial

We are going to make this as simple as possible. We are going to create 2 pages, these pages are sample.htm and sampleproc.cfm.

There will be 3 sets of code snippets used, they are;
- the form
- javascript validation
- the processing form
sample.htm

here is the code to put in your sample.htm page.

ColdFusion Syntax (Toggle Plain Text)
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <title>Sample Page!</title>
  7. <script language="javascript">
  8. <!--
  9. function validateit()
  10. {
  11. temp = true;
  12.  if(document.form.name.value == '' || document.form.phone.value == '')
  13. {
  14. temp = false;
  15. alert('Please fill out the Name and Phone field to continue...');
  16. }
  17.  return temp;
  18. }
  19. //-->
  20. </script>
  21. </head>
  22. <body>
  23. <p align="center"><strong>INSTANT CALL BACK</strong><br>enter you name and number<br>and I will call you immediately.</p>
  24. <form name="form" action="sampleproc.cfm" method="post" enctype="multipart/form-data" onSubmit="return validateit();">
  25. <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  26. <tr>
  27. <td width="125" valign="middle"> <div align="right">Your Name:&nbsp; </div></td>
  28. <td width="150" valign="top"><input type="text" name="name" onFocus="this.value=''" style="width:150px"></td>
  29. <td width="25" valign="middle"><div align="center">*</div></td>
  30. </tr>
  31. <tr>
  32. <td valign="middle"> <div align="right">Phone Number:&nbsp; </div></td>
  33. <td valign="top"><input type="text" name="phone" onFocus="this.value=''" style="width:150px" ></td>
  34. <td valign="middle"><div align="center">*</div></td>
  35. </tr>
  36. <tr>
  37. <td valign="top"><div align="right">
  38. </div></td>
  39. <td valign="top"><div align="right">
  40. <input type="submit" name="Submit" value="Call Me">
  41. </div></td>
  42. <td valign="top">&nbsp;</td>
  43. </tr>
  44. </table>
  45. </form>
  46. </body>
  47. </html>

Basically, we have the HTML code for the form as well as an easy javascript fro you to undertand to validate the form before submitting it to the next page.

sampleproc.cfm

This is where we will process the code. Put this in your sampleproc.cfm page.

ColdFusion Syntax (Toggle Plain Text)
  1. <CFMAIL To="phonenumber@cellphoneprovider.com" From="you@youremail.com" Subject="Web Alert" server="mail.yourmailserver.com">
  2. call #form.name# at #form.phone#
  3. FROM WEB SITE, Instant Call Back
  4. </CFMAIL>
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  8. <title>Confirmation</title>
  9. <script language="javascript" type="text/javascript">
  10. alert( "I have received your request and will be contacting you shortly" );
  11. location.href = "sample.htm";
  12. </script>
  13. </head><body></body></html>

Okay Thats it, have fun and remember to "think outside of the box".
Reputation Points: 10
Solved Threads: 0
Newbie Poster
igotdreams is offline Offline
18 posts
since Jan 2005
Jan 1st, 2005
0

Re: Send a text message to your phone from your site!

Cool idea.
I notice your phone number there is a US one, where you have the state/region code and then phone number.
How would this work in other countries ? would we need to add the country code ( e.g. Uk = +44 so "44") followed by the mobile phone number ?
Does the format follow the common UK practise of add country code and drop the leading 0 on the phone number ?...
Reputation Points: 12
Solved Threads: 5
Junior Poster
ReDuX is offline Offline
127 posts
since Sep 2004
Jan 1st, 2005
0

Re: Send a text message to your phone from your site!

These guidlines would be set by your cell phone (mobile) provider.

It should work because it is just like an email address. All emails are unique and if your cell phone provider gave you a unique one, then it will not matter what country can send you a message.

Send your self an email first before you upload this to your site.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
igotdreams is offline Offline
18 posts
since Jan 2005
Feb 14th, 2005
0

Re: Send a text message to your phone from your site!

Is there anyway that we can send messages to somebody else using this code. FOr example using my phone number in this code but to send the text message to somebody else phone number.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mohachenawi is offline Offline
1 posts
since Feb 2005
Feb 14th, 2005
0

Re: Send a text message to your phone from your site!

I've also modified the code from my cell phone provider's website. They usually have the form right on there to send a text message... grab the code from there and use your cell phone provider's already-in-place processing.
Reputation Points: 15
Solved Threads: 0
Junior Poster in Training
2ndPlatform is offline Offline
61 posts
since Nov 2004
Feb 15th, 2005
-1

Re: Send a text message to your phone from your site!

Quote originally posted by mohachenawi ...
Is there anyway that we can send messages to somebody else using this code. FOr example using my phone number in this code but to send the text message to somebody else phone number.
Of coarse you can, just put in there telephone number instead of yours. Find out what provider they have and get the email address information. Easy.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
igotdreams is offline Offline
18 posts
since Jan 2005
Mar 2nd, 2005
0

Re: Send a text message to your phone from your site!

cool feature. but i'm problem implementing it, for the part "phonenumber@cellphoneprovider.com", what do i put down for "cellphoneprovider.com"? does it work for any phone provider in the world?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
aixhero is offline Offline
1 posts
since Mar 2005
Mar 3rd, 2005
0

Re: Send a text message to your phone from your site!

Quote originally posted by aixhero ...
cool feature. but i'm problem implementing it, for the part "phonenumber@cellphoneprovider.com", what do i put down for "cellphoneprovider.com"? does it work for any phone provider in the world?
you would put YOUR cell phone provider! Who ever gives you service, you need to find out what the email address of your phone is. So you would go to the website of your service provider and look for this information or read your manaul.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
igotdreams is offline Offline
18 posts
since Jan 2005
Jul 30th, 2005
0

Re: Send a text message to your phone from your site!

Does anyone know what it is for Cingular service?
Reputation Points: 17
Solved Threads: 5
Posting Whiz in Training
mmiikkee12 is offline Offline
274 posts
since Oct 2004
Aug 1st, 2005
0

Re: Send a text message to your phone from your site!

hi der!!! its such a kewl idea to do sumthng like dat by coding.......i am not clear on how to use the code.....it wud be great if u cud elaborate stepwise on how to use the code.....thanx a lot....appreciate ur help...
insatiable
Reputation Points: 10
Solved Threads: 0
Newbie Poster
insatiable is offline Offline
2 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in ColdFusion Forum Timeline: Background color not displayed if set after any text formatting
Next Thread in ColdFusion Forum Timeline: Match Strings using REFind





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC