I would like to have a SEND TO PHONE form on my web site. I'm creating a separate mobile site and I would like to give visitors of my main web site an easy fill-in form that allows visitors to enter their 10-digit mobile number and click a SEND button (SEND TO PHONE), and a pre-written URL link is automatically sent to the visitors mobile phone. Can someone please tell me what is needed to accomplish this? Google Mobile has such a form. How does it work? I've seen similar forms where visitors input a 10-digit number and select their service provider on a drop-down list bfore clicking SEND... any help in this matter would be greatly appreciated.

Thank You!

Keith Welch.
kw.grafxpro@gmail.com

Recommended Answers

All 8 Replies

You need access to an SMS gateway. You can hire this access from a number of companies, usually they'll charge a subscription or usage fee. I can't recommend any, but that's what you need; heres some examples, from the first page of google results for SMS gateway: http://www.clickatell.com/ http://www.ozeki.hu/** , and this page has some comparisons : http://www.developershome.com/sms/smsGatewayProvComp.asp . This assumes that your target audience is in a country that uses SMS for mobile text messages..

The code you use would depend on the gateway service, they'll likely have their own access/security protocol and provide specific developer instructions.

** hm, I had a look at this one again, it's not a rented service, it lets you use your phone/sim/contract as an SMS server; which is a different approach; probably not useful for high volumes of texts, but perhaps worth looking at.

You need access to an SMS gateway. You can hire this access from a number of companies, usually they'll charge a subscription or usage fee. I can't recommend any, but that's what you need; heres some examples, from the first page of google results for SMS gateway: http://www.clickatell.com/ http://www.ozeki.hu/** , and this page has some comparisons : http://www.developershome.com/sms/smsGatewayProvComp.asp . This assumes that your target audience is in a country that uses SMS for mobile text messages..

The code you use would depend on the gateway service, they'll likely have their own access/security protocol and provide specific developer instructions.

** hm, I had a look at this one again, it's not a rented service, it lets you use your phone/sim/contract as an SMS server; which is a different approach; probably not useful for high volumes of texts, but perhaps worth looking at.

Hi Matt!
Thanks for your timely response! Please note that I'm a bit of a novice at this whole thing with only a year or so of web design under my belt, yet I know well enough that it would help a great deal if I had a SEND TO PHONE form on my main site, so that visitors could automatically get the link to my mobile site sent to their mobile phones.

I was actually hoping for a more inexpensive way to accomplish this goal, as the budget is quite meager at this point in time. And, just for the record, I'm signed up with a web site called TextMarks (http://textmarks.com)...the allow usage of your own chosen keyword along with their own 5-digit number (41411)...it allows me to create my own (pre-written) textmsg (in this case, the URL to my mobile site). When a mobile phone texts the keyword to the 5-digit number, the sender gets the automatic (pre-written) txtmsg sent to their phone/device. I wish I knew of a way to get it to work the other way around... where the visitors input their 10-digit number in the form and simply click send and voila! they get that URL link sent to their phone. Is there a way that I can create a SEND TO PHONE function with just HTTP?

I looked into this matter a few months ago, yet I learned that some of the companies that offer this service are quite expensive. I may have to resort to doing it the poor-mans way...Manually! Hahahaha!!! Perhaps I'll sign-up for an unlimited txtmsg plan with my current mobile service provider and I'll set up pre-written URL messages to send out each time I get a hit on the keyword sent to my own mobile phone! Yeah... automatic access sounds much better, hunh?

Keith.

Google PHP form mail, you will find some free PHP scripts and form templates that you can customize to suit your needs.

Using the form and PHP scripts, send the PHP mailer the address to send your message to by having the user input their 10 digit phone number and selecting their carrier, put the email address together like this:
"10 digit phone number@carrier"
where carrier is:

AT&T @mobile.att.net
Alltel @message.alltel.com
Cingular @mobile.mycingular.com
Nextel @messaging.nextel.com
Sprint @messaging.sprintpcs.com
SunCom @tms.suncom.com
T-mobile @tmomail.net
VoiceStream @voicestream.net
Verizon @vtext.com

I tried this with my PHP mailer and phone carrier "7758675309@mobile.mysingular.com", passed that as the email address to the PHP script and it worked like a charm, you don't need to subscribe to anything or pay anyone any money, you simply need your HTML form that submits to a PHP mailer (or other cgi mailer, I just prefer PHP).

You will want to spend some time reading about different PHP mailer scripts and the security risks involved and how to minimize that risk, especially since you are allowing the TO address to be generated client side, you run the risk of getting hijacked by spammers using your form mailer to do their dirty work.

If you find an HTML form and PHP script to try out but need some help, let me know, I will see if I can help you out with it.

Looking at the PHP mailer scripts I have, there is a lot of unnecessary code so I just made a stripped down script that does the task with the exception of validating the user input of the 10-digit phone number, you would want to strip an NaN chars out of it and make sure you had 10 numbers left to build the TO address.
The form will submit to "phpmailer.php" the user-input, and a value that the php script will use to determine the rest of the TO address, I did it this way to avoid building the TO address client side where you do not have strict control of the data.
Here is the simple HTML form:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<form action="phpmailer.php" method="post" name="theform">
<p>
<input type="hidden" name="redirect" value="message_success.php">
<input type="text" name="10digit"> Enter your 10-digit cell number<br>
<select name="carrier">
	<option value="att">AT&amp;T</option>
	<option value="alltel">Alltel</option>
	<option value="cingular">Cingular</option>
	<option value="nextel">Nextel</option>
	<option value="sprint">Sprint</option>
	<option value="suncom">SunCom</option>
	<option value="tmobile">T-mobile</option>
	<option value="voicestream">VoiceStream</option>
	<option value="verizon">Verizon</option>
</select>Select your carrier<br>
<input type="submit" value="submit" name="submit">
</p>
</form>
</body>
</html>

In the php mail script we control the building of the TO address, I did not add 10-digit user-input verification, this script the way it is uses the raw user-input, you would absolutely want to verify this however you see fit.
The script:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<p>
<?php
if (!isset($_POST['submit'])){error("Must use form to get here!");}
$ph = $_POST['10digit'];//get the users phone number from the form
$carrier = $_POST['carrier'];//get the carrier

// we will build the send-to address here in php instead of letting it be generated client-side
// this will restrict the mailer to only sending the canned message to a 10 digit phone on one 
// of the specified carrier networks

// you will want to add some kind of validation of the 10-digit phone number here, ie. make sure
// it is 10 digits long, only contains digits, remove and alpha chars etc.

// now lets build the email address depending on the selected carrier
switch ($carrier){
	case 'att':
		$to = $ph . '@mobile.att.net';
		break;
	case 'alltel':
		$to = $ph . '@message.alltel.com';
		break;
	case 'cingular':
		$to = $ph . '@mobile.mycingular.com';
		break;
	case 'nextel':
		$to = $ph . '@messaging.nextel.com';
		break;
	case 'sprint':
		$to = $ph . '@messaging.sprintpcs.com';
		break;
	case 'suncom':
		$to = $ph . '@tms.suncom.com';
		break;
	case 'tmobile':
		$to = $ph . '@tmomail.net';
		break;
	case 'voicestream':
		$to = $ph . '@voicestream.net';
		break;
	case 'verizon':
		$to = $ph . '@vtext.com';
		break;
	default:
		error("No carrier selected, message not sent!");
}

// create our canned message
$message = "http://www.mymobilewebsite.com/";

// and the subject line
$subject = "URL to mobile website.";

// need a 'from' header
$from = "From: webmaster@mymobilewebsite.com";

// send the mail
mail($to, $subject, $message, $from);
// you may want to redirect to another page after successfull mailing, or provide a 'back' link
echo "Your message has been sent!";
exit();
// the error function that will echo your error message
function error($msg){
	echo "An error has occurred: ".$msg;
	exit();
}
?>
</p>
</body>
</html>

Just for simplicity I just put this in html and echoed success or failure, you might want to redirect or put in a back link.

I tested this with my cell phone on the cingular network and it worked just fine.
Hopefully some PHP experts can advice on security risks.

Good luck.

Google PHP form mail, you will find some free PHP scripts and form templates that you can customize to suit your needs.

Using the form and PHP scripts, send the PHP mailer the address to send your message to by having the user input their 10 digit phone number and selecting their carrier, put the email address together like this:
"10 digit phone number@carrier"
where carrier is:

AT&T @mobile.att.net
Alltel @message.alltel.com
Cingular @mobile.mycingular.com
Nextel @messaging.nextel.com
Sprint @messaging.sprintpcs.com
SunCom @tms.suncom.com
T-mobile @tmomail.net
VoiceStream @voicestream.net
Verizon @vtext.com

I tried this with my PHP mailer and phone carrier "7758675309@mobile.mysingular.com", passed that as the email address to the PHP script and it worked like a charm, you don't need to subscribe to anything or pay anyone any money, you simply need your HTML form that submits to a PHP mailer (or other cgi mailer, I just prefer PHP).

You will want to spend some time reading about different PHP mailer scripts and the security risks involved and how to minimize that risk, especially since you are allowing the TO address to be generated client side, you run the risk of getting hijacked by spammers using your form mailer to do their dirty work.

If you find an HTML form and PHP script to try out but need some help, let me know, I will see if I can help you out with it.

Thank for your information. I in the same case. I find you system very simple and I need to know more about it. I'm from africa. I have portal And need plus the free webmailing service, add fre sms service for all user.
Can you help me please?
Other wise, I look for partner for my portal business. Intesting, notify me. www.zamana.bf

Most SMS systems have pretty tight limitations on the amount of text which can be sent, which would include header information. You will need to check the completed output to make sure you don't exceed the limitations of each carrier listed. Otherwise, that's a very good process for handling the job at hand.

You just need to integrate SMS API into your website. You need to get api key from any Messaging provider like Spring Edge.
for CMS like joomla, opencart, woo commerce, zencart, wordpress, SpringEdge's messaging Modules can be used. Get API Key from Spring Edge Messaging Gateway Provider.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.