1,105,416 Community Members

Send a text message to your phone from your site!

Member Avatar
igotdreams
Newbie Poster
18 posts since Jan 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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".

Member Avatar
ReDuX
Junior Poster
122 posts since Sep 2004
Reputation Points: 1 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

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 ?...

Member Avatar
igotdreams
Newbie Poster
18 posts since Jan 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
mohachenawi
Newbie Poster
1 post since Feb 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
2ndPlatform
Junior Poster in Training
61 posts since Nov 2004
Reputation Points: 5 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
igotdreams
Newbie Poster
18 posts since Jan 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

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.

Member Avatar
aixhero
Newbie Poster
1 post since Mar 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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?

Member Avatar
igotdreams
Newbie Poster
18 posts since Jan 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
mmiikkee12
Posting Whiz in Training
264 posts since Oct 2004
Reputation Points: 1 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

Does anyone know what it is for Cingular service?

Member Avatar
insatiable
Newbie Poster
2 posts since Aug 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
insatiable
Newbie Poster
2 posts since Aug 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hey, i just figured out wat to do with the code, but halfway thru.....the code which says 'sampleproc.cfm' dint work for me..........wats exactly '.cfm' code???? i really dint understand how the code works......can u plz explain...am curious...thnk u!!!!
........insatiable

Member Avatar
janedwilder
Newbie Poster
1 post since Nov 2005
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

is there a way to have a field in the form that will allow a user to type in any mobile# they want? I need for the option of this to enable a user to suubmit a message to any mobile phone. If you could figure this out I could compensate you.

Member Avatar
cyberdata
Newbie Poster
2 posts since Sep 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

i am making a site and having problem with the script and i want to know what should be in the action field i am using dreamweaver i put smaple.cfm but it poped up and then i put http://9547090928@mymetropcs.com and it still no work i was wonder if i am doin something wrong in posting it i need help with this

Member Avatar
ckarnuth
Newbie Poster
6 posts since Jul 2006
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have tried the web pages that you have created, entering the phone number that i wish for the text message to go to and changing email addresses, however when I click on the call me button, it opens up a file download field, asking if i would like to open or save the file. If I click open it opens in Dreamweaver and does not send the message. Can you please help ?
I can attach the code back if you would like to make sure that I didn't do anything wrong.

Member Avatar
cfmatt
Newbie Poster
3 posts since Feb 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have tried the web pages that you have created, entering the phone number that i wish for the text message to go to and changing email addresses, however when I click on the call me button, it opens up a file download field, asking if i would like to open or save the file. If I click open it opens in Dreamweaver and does not send the message. Can you please help ?
I can attach the code back if you would like to make sure that I didn't do anything wrong.

Are you serving the pages from a coldfusion server.
It sounds like you are not hence the file download.

Matt

Member Avatar
cfmatt
Newbie Poster
3 posts since Feb 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hey, i just figured out wat to do with the code, but halfway thru.....the code which says 'sampleproc.cfm' dint work for me..........wats exactly '.cfm' code???? i really dint understand how the code works......can u plz explain...am curious...thnk u!!!!
........insatiable

.cfm is a Coldfusion page, similar to asp, php scripting.

To make this code work the pages need to be served (hosted) on a coldfusion server otherwise this will not work.

Matt

Member Avatar
mattyfed
Newbie Poster
2 posts since Jun 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

here is a page that lists a ton of providers and how to send to them

http://www.livejournal.com/tools/textmessage.bml?mode=details

Member Avatar
ZenMartian
Newbie Poster
22 posts since Sep 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Hello... Although I came across your thread a tad late, I've been Googling everywhere trying to find others who could help me solve a matter of how to create a SEND-TO-PHONE function on my website. The thing is, I want visitors to input their own 10-digit number in the small form, Click the SEND TO PHONE button...and within seconds, they automatically receive a txtmsg which includes the URL to my mobile website. Any ideas how I can do this in a cost effective manor? I've checked out quite a few sms gateway services that handle this, yet they're a bit to costly for my budget at this point in time.

TextMarks (www.textmarks.com) has a cool app that allows you to create a keyword and use it with their dedicated 5-digit number, so you can do your own "Txt 'keyword' to 12345" promotion campaigns, etc. The catch is, it has to be txted from a mobile phone. I wish I could borrow that code and implement it on my website, so that visitors can also txt their 10-digit number from my site and they get the txtmsg bounced to their phone. Any help with this matter would be greatly appreciated.

Thanks!
Keith Welch

Member Avatar
Quantumphp
Newbie Poster
5 posts since Dec 2007
Reputation Points: 1 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
1
 

There is another great tutorial about sending custom text messages from your website.
It's at

http://www.easykiss123.com/tutorials/sms_simple/index.html

It is set up so you custom text messages can be sent to users after they put in their phone number. Nice!

Quantumphp

Member Avatar
ZenMartian
Newbie Poster
22 posts since Sep 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi QuantumPHP! :-) Tried responding to you earlier today, yet I think it didn't go through when I hit SEND. First of all, I want to thank You so, so much for leading me towards the right direction with an answer to the mystical "Send a TxtMsg to your phone from your Site"! LOL!!!! Wow!! I downloaded those files and truth be told, it does actually work!! I'm Thrilled!! :-)

Of course...heh-heh... I do have a couple of questions for ya... I'm not a php master by far, yet I noticed the smsphp form has a 'print' command/function which displays whatever text is written in that area, onto a web page (user side)...ok... Well, here's two things that came up... On one hand, I slightly modified the smsphp form and I tried using it within an iFrame on my Site, which looked and worked quite well. The problem is, when you enter a phone number/click send-to-phone, that's when the "Your Txt Was Sent Successfully" msg displays itself within the iFrame... h'mmmm. Sort of looks quite out of place against the color background surrounding the rest of the site. Somehow, I need to have it be a separate web page linked to the form, so that I could have a bit more control over the look of the web page color/font, etc. (hope I'm explaining it correctly). Also, if there's a way to make it work as I explained, then I think a RESET button would help too, if it were situated on that same page.

Secondly... I could make the smsphp form do a pop-up action (target=blank), showing the form in a separate window/web page, yet I'd still appreciate more control over the look of the "Your Txt Was Sent Successfully" web page.

And, lastly..just out of curiousity... how do you create a link within that same {print;} function?? The text reads "Your Text Was Sent Successfully...etc." How can I place a url link within that text? Example: "Click Here To Go back To Home Page" ...??!? How do you code this as a URL within the PHP so that it displays as a LINK on the user side?

Thank you very much for your time on this matter! :-)

Sincerely,
Keith/ZenMartian

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article