Email to SMS – The Manual Way
Using email to SMS is an efficient way to get in touch with your contacts. But what lies behind this easy way to send messages?
Knowing what goes on behind the screens makes what’s going on in front of the screens more controllable. It’s like driving a car: if you know what all the engine parts do and how they should be working, then you stand a good chance of getting yourself out of trouble and possibly saving a bit when disaster strikes. The same applies to email to SMS.
SMTP: The Simple Mail Transfer Protocol
Delving beneath the surface, we note that the SMTP protocol is probably one of the most widely used mail-sending protocols, and is the default on most email clients. This is the protocol that makes email to SMS possible, by taking the following steps:
- You compose the message you want to convert from email to SMS in your mail client
- It connects to port 25 of your mail server
- A number of commands are issued and your message gets sent.
Those with a bit of technical know-how could try this out on their own, too. It is as simple as establishing a telnet connection to an outgoing mail server to convert email to SMS.
Now, the basic modus operandi of connecting to a mail server to send a message through SMTP is:
bash-4.0$ telnet smtp.youroutgoingmailserver.com 25
Trying <ip address>…
Connected to smtp.youroutgoingmailserver.com.
Escape character is ‘^]’.
220 smtp.youroutgoingmailserver.com ESMTP
helo server
250 smtp.youroutgoingemailserver.com
mail from: yourname@youremailaddress.com
250 Ok
rcpt to: sms@messaging.clickatell.com
250 Ok
Data
354 End data with <CR><LF>.<CR><LF>
Hello World, this is a mail from John Doe.
.
250 Ok: queued as 5B161188035
To convert email to SMS, however, you need to add a few parameters. These include:
user:your_username
password:your_password
api_id: xxxxxxx
to: xxxxxxxxxxx
reply:yourname@youremailaddress.com
text: This is your 160-char SMS message.
And that’s it. Or is it? If you’ve tried the above, then you probably noticed that your email to SMS conversion didn’t work, and here’s why: you need to specify the email type, as most servers will only accept 7-bit characters. This is done by manually entering the email header data:
MIME-Version: 1.0
From: You < yourname@youremailaddress.com >
To: sms@messaging.clickatell.com
Subject: (no subject)
Content-type: text/plain; charset=US-ASCII
Of course, you’ll have to replace all the necessary fields with your own data to ensure that your email to SMS conversion works perfectly. Here’s how the entire completed message should look:
bash-4.0$ telnet smtp.youroutgoingmailserver.com 25
Trying <ip address>…
Connected to smtp.youroutgoingmailserver.com.
Escape character is ‘^]’.
220 smtp.youroutgoingmailserver.com ESMTP
helo server
250 smtp.youroutgoingemailserver.com
mail from: yourname@youremailaddress.com
250 Ok
rcpt to: sms@messaging.clickatell.com
250 Ok
Data
354 End data with <CR><LF>.<CR><LF>
MIME-Version: 1.0
From: You < yourname@youremailaddress.com >
To: sms@messaging.clickatell.com
Subject: (no subject)
Content-type: text/plain; charset=US-ASCII
user:your_username
password:your_password
api_id:xxxxxxx
to:xxxxxxxxxxx
reply:yourname@youremailaddress.com
text: This is your 160-char SMS message.
.
250 Ok: queued as 5B161188888
Once you’ve got the above pat, all that’s left to do is to familiarise yourself with the optional parameters. This can be done by examining the email to SMS SMTP API guide. Pay special attention to the ‘concat’ parameter for those instances where you want to send messages in excess of the standard 160 characters.
Ready to get cracking? Follow the link to start converting your email to SMS.
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.
One Comment On This Post
[...] Email to SMS – The Manual Way, we took a look at the Simple Mail Transfer Protocol (SMTP) and how you could use it to send either [...]