JNSoftware
Forward Mail to SMS
We are keeping this script posted (see below) as it has some use as a learning script but not much utility for its intended purpose. This is because most mobile phone providers automatically create an email address for all their mobile phone subscribers. For instance, our carrier, T-Mobile, uses the format: 2125551212@tmomail.net for their email addresses where the username is simply the full mobile phone number including the area code. So, to send an SMS to your phone, just send an email to this address. (You should contact your mobile phone provider—or see their website—for more information about finding out if your phone has an email address.)
Here is an example of a script that demonstrates how to send an SMS to a mobile phone via email. The following AppleScript can be used to send an SMS to your T-Mobile phone via Mail.app but could very easily be adapted to other carriers and other mail clients. (If you’re using Mac OS X 10.3.x, click the script icon to open this script in a new Script Editor window):
script set the_number to "2125551212@tmomail.net"
set the_message to "My Message"
set the_subject to "My Subject"

tell application "Mail"
    set new_message to (make new outgoing message at end of outgoing messages)
    tell new_message
        set visible to true
        make new to recipient at end of to recipients with properties {address:the_number}
        set subject to the_subject
        set content to the_message
        send
    end tell
end tell



script icon
Version: 1.0b
Release Date: July 19, 2003
Requirements: Mac OS X 10.3+
Script Type: Editable
License: Freeware (GPL)
Installation: Download, expand, and place in the “~/Documents/Microsoft User Data/Entourage Script Menu Items” folder. Then, from within Entourage, create a new Rule (Tools>Rules) and name it “Forward to SMS” (or whatever you want, really). Set the If options of this new rule to execute “if all criteria are met” and set a single criterion of “All messages.” Set the Then options to a single action, “Run AppleScript.” Click the “Script...” button, navigate to the “Forward Mail to SMS.scpt” file and select it. Next, enable and save the Rule. (Almost done.) To test and initialize the script, make sure there is at least one message in your Inbox, select “Forward Mail to SMS” from the Entourage script menu. You will be prompted to enter your cell phone number. Enter it with the area code in the format ###-###-#### (e.g., 212-555-1212). The script will then attempt to forward the message to your phone via iChat. With the Rule you created enabled, whenever a message is received, it will be forwarded to this cell phone number. To change the number, you’ll need to edit the script in the Script Editor. For maximum benefit, keep your machine on without going to sleep (put the screen to sleep, though), create a Schedule in Entourage to constantly check for new mail from your accounts (we use one that checks every 5 minutes), and login to iChat (perhaps changing your message to away but still logged in). This setup works best for users with always-on connections (i.e., cable or DSL).
Description: This script is meant to work in conjunction with Microsoft Entourage (although it could easily be modified for other mail clients such as Mail.app). If you configure Entourage to use this script as detailed above, it will forward your new mail as an SMS to your cell phone so you’ll never miss that important email again. When a message is forwarded using this method, it will remain in your Inbox marked as unread until you actually read it in Entourage. Other Rules you’ve created may conflict with this so please test your settings (enable the Rule and send a message to yourself).
Some caveats: This script requires that GUI Scripting is enabled (turn on “Enable access for assistive devices” in the Universal Access Preference pane); the SMS won’t have proper line endings (when the GUI scripting tries to type the line endings in the iChat window, iChat interprets this as a “Send Now” command). Instead, line endings will be delimited with “ ** ” (again, you can modify this in the script); the SMS on our mobile system (T-Mobile) appear to be limited to 150 characters or so; you may be charged an additional fee for receiving SMS on your phone, check with your carrier for more information; this may work in iChat 1.0 but it was only tested with iChat AV. Feedback is greatly appreciated.
We thinking of taking down this script as most mobile phone providers automatically create an email address for all their mobile phone subscribers. For instance, our carrier, T-Mobile, uses the format: 2125551212@tmomail.net for their email addresses where the username is simply the full mobile phone number including the area code. You should contact your mobile phone provider (or see their website) for more information about finding out if your phone has an email address or if the people you wish to send an SMS to also have an email address based on their phone number. If so, you can simply create a rule to forward all mail to this email address.