Sunday, June 1, 2008

SMS Sender

The SMS Sender is javascript that formats an e-mail from your computer for delivery to your phone company's sms-email gateway. That gateway then forwards the email as a text message to your cell phone. On your cell phone, if you reply to that text message, it goes back to the gateway and is converted to an e-mail and sent to your email service.

It shows the mechanics of how a computer can send and receive messages from a cell phone and this is the essence of how sms marketing is done, except this is using your email client for demo purposes.

The javascript code is:

(SCRIPT LANGUAGE="JavaScript")(!--
function getLink(text) {
for (var i=0; i(document.links.length; i++)
if (document.links[i].href == text) return i;
return null;
}

function gmrAddr() {
var output = 'mailto:';
for (var i=0; i(document.smsGateways.selectName.length; i++) {
if (document.smsGateways.selectName[i].selected) {
if (output == 'mailto:')
output += '?to=' + document.smsGateways.selectName[i].value;
else
output += '&to=' + document.smsGateways.selectName[i].value;
}
}
document.links[mailtoLink1].href = output;
}
//--)(/SCRIPT)

(FORM NAME="smsGateways")
(select name="selectName")
(option value="@messaging.sprintpcs.com")Sprint Mobile(/option)
(option value="@vmobl.com")Virgin Mobile(/option)
(option value="@vtext.com")Verizon Mobile(/option)
(option value="@teleflip.com")Teleflip(/option)(/select)
(/FORM)

(A HREF="mailto:gmr" onClick="gmrAddr()")Send Mail(/A)

(SCRIPT LANGUAGE="JavaScript")(!--
var gmrMail= getLink('mailto:gmr');
//--)(/SCRIPT)


No comments: