User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 456,452 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,600 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 42278 | Replies: 28
Reply
Join Date: Jan 2005
Location: Orlando
Posts: 17
Reputation: igotdreams is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
igotdreams igotdreams is offline Offline
Newbie Poster

Send a text message to your phone from your site!

  #1  
Jan 1st, 2005
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.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sample Page!</title>
<script language="javascript">
<!--
function validateit()
{
temp = true;
 if(document.form.name.value == '' || document.form.phone.value == '')
	{
	temp = false;
	alert('Please fill out the Name and Phone field to continue...');
	}
 return temp;
}
//-->
</script>
</head>
<body>
<p align="center"><strong>INSTANT CALL BACK</strong><br>enter you name and number<br>and I will call you immediately.</p>
            <form name="form" action="sampleproc.cfm" method="post" enctype="multipart/form-data" onSubmit="return validateit();">
			<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">       
			  <tr> 
                <td width="125" valign="middle"> <div align="right">Your Name:&nbsp; </div></td>
                <td width="150" valign="top"><input type="text" name="name" onFocus="this.value=''" style="width:150px"></td>
			    <td width="25" valign="middle"><div align="center">*</div></td>
			  </tr>
              <tr> 
                <td valign="middle"> <div align="right">Phone Number:&nbsp; </div></td>
                <td valign="top"><input type="text" name="phone" onFocus="this.value=''" style="width:150px" ></td>
                <td valign="middle"><div align="center">*</div></td>
              </tr>
              <tr>
                <td valign="top"><div align="right">
                  </div></td>
                <td valign="top"><div align="right">
                  <input type="submit" name="Submit" value="Call Me">
                </div></td>
                <td valign="top">&nbsp;</td>
              </tr>
            </table>
</form>
</body>
</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.

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


Okay Thats it, have fun and remember to "think outside of the box".
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Location: in the j00-kay
Posts: 114
Reputation: ReDuX is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 5
ReDuX's Avatar
ReDuX ReDuX is offline Offline
Junior Poster

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

  #2  
Jan 1st, 2005
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 ?...
I'm pink, therefore, im spam.
http://www.vivaci.net - Quality Webhosting
http://gaming.vivaci.net - FAST UK Gaming servers
http://www.getsigned.org - Free Image Uploads
Reply With Quote  
Join Date: Jan 2005
Location: Orlando
Posts: 17
Reputation: igotdreams is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
igotdreams igotdreams is offline Offline
Newbie Poster

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

  #3  
Jan 1st, 2005
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.
Reply With Quote  
Join Date: Feb 2005
Posts: 1
Reputation: mohachenawi is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
mohachenawi mohachenawi is offline Offline
Newbie Poster

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

  #4  
Feb 14th, 2005
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.
Reply With Quote  
Join Date: Nov 2004
Location: Milwaukee, WI
Posts: 62
Reputation: 2ndPlatform is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
2ndPlatform's Avatar
2ndPlatform 2ndPlatform is offline Offline
Junior Poster in Training

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

  #5  
Feb 14th, 2005
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.
Reply With Quote  
Join Date: Jan 2005
Location: Orlando
Posts: 17
Reputation: igotdreams is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
igotdreams igotdreams is offline Offline
Newbie Poster

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

  #6  
Feb 15th, 2005
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.
Dan Kinchen
One Step Solutions Corp.

Provides website design services outside of the Orlando, Florida metro area.
Reply With Quote  
Join Date: Mar 2005
Posts: 1
Reputation: aixhero is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
aixhero aixhero is offline Offline
Newbie Poster

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

  #7  
Mar 2nd, 2005
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?
Reply With Quote  
Join Date: Jan 2005
Location: Orlando
Posts: 17
Reputation: igotdreams is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
igotdreams igotdreams is offline Offline
Newbie Poster

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

  #8  
Mar 3rd, 2005
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.
Dan Kinchen
One Step Solutions Corp.

Provides website design services outside of the Orlando, Florida metro area.
Reply With Quote  
Join Date: Oct 2004
Location: On Earth, I think...
Posts: 246
Reputation: mmiikkee12 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 4
mmiikkee12's Avatar
mmiikkee12 mmiikkee12 is offline Offline
Posting Whiz in Training

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

  #9  
Jul 30th, 2005
Does anyone know what it is for Cingular service?
Reply With Quote  
Join Date: Aug 2005
Posts: 2
Reputation: insatiable is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
insatiable insatiable is offline Offline
Newbie Poster

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

  #10  
Aug 1st, 2005
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ColdFusion Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 2:03 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC