Email to SMS Scripting Made Easy
Email to SMS is a powerful messaging medium with immense scalability potential – use it for all your notifications, alerts and one-way promotional messages. Here’s how you can automate the process.
So let’s take a step by step look at how you can automate your email to SMS processes. You don’t need to be a genius or even too proficient with computers. All you’ll need to do is follow these steps.
Before You Begin
Kicking off with email to SMS, let’s look at the length of your average text message. The default is 160 7-bit characters per message, with the possibility of concatenation (meaning more than 160 7-bit characters). These characters are defined in the GSM 7-bit alphabet. If you’re going to look up said alphabet, just keep in mind that there’s also an extension table with 10 extra characters defined.
Characters that do not form part of the 7-bit alphabet are most likely 8-bit and will therefore shorten the standard length of your text messages.
Script Variables
Now you’re ready to start creating that script to convert your email to SMS. For the purposes of this example, we took an existing VBA script and converted it to SMS the subject to a destination phone. Using this script in your favourite email client, you’ll be able to create a filter or message rule that activates the script when, for instance, a specific person sends you an email.
Take note of the statically coded variables. These include:
- “user:<your username>”
- “password:<your password>”
- “api_id:<your API ID>”
- “concat:1″
- “reply:<your reply address>”
- “to:<the destination number>”
- “text:<leave blank>”
From the above you’ll note that ‘concat‘ has been left at ‘1′. This can be left out as ‘1′ is the default value of this parameter. It specifies the number of parts the message should be broken into when the email to SMS operation takes place, and is only applicable when the subject will exceed 160 characters (in this case, however, it is recommended that it be left at one as not all email subjects will exceed 160 characters). Additionally, the ‘text‘ field has also been left blank seeing as it will be followed by the subject of the mail.
Here’s the complete script:
Sub SendSMS(Item As Outlook.MailItem)
Dim objMail As Outlook.MailItem
Set objItem = LoadOrigMessage()
Set objMail = objItem.Forward
objMail.To = “sms@messaging.clickatell.com”
objMail.Body = “user:<your username>” & vbCrLf & “password:<your password>” & vbCrLf & “api_id:<your API ID>” & vbCrLf & “concat:1″ & vbCrLf & “reply:<your reply address>” & vbCrLf & “to:<the destination number>” & vbCrLf & “text:<leave blank>” & “Subject: <leave blank> ” & objMail.Subject
objMail.Send
Set objItem = Nothing
Set objMail = Nothing
End Sub
Function LoadOrigMessage() As Object
Dim objApp As Outlook.Application
Set objApp = Application
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case “Explorer”
Set LoadOrigMessage = _
objApp.ActiveExplorer.Selection.Item(1)
Case “Inspector”
Set LoadOrigMessage = _
objApp.ActiveInspector.CurrentItem
Case Else
End Select
End Function
Now what the above script does, is to load the function ‘LoadOrigMessage‘ from within ‘Sub SendSMS‘. This will load the original message to be forwarded to the server that makes email to SMS possible. Note, however, that the original message body will be replaced by the values specified in ‘objMail.Body‘, and only the subject of the original mail is passed on. See how easy it is?
Getting closer to the end, there’s only one additional thing you should take into account regarding email to SMS: messages should be sent to the destination email address in plain text. To do this, you’d either have to set your default message format as plain text or add functionality to the script that converts the text to plain text.
And that’s all there is to it. Feel free to use this for yourself or for your company organisation – follow the link to read more about email to SMS and start sending with 10 free test credits!
No related posts.
Related posts brought to you by Yet Another Related Posts Plugin.
Tags: 160 character messaging, email to SMS, email to SMS script, outlook express SMS script, outlook SMS script, SMTP API, VBA SMS script
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.
No Comments Yet