Text Messaging with VisualWorks

One very easy way of sending text messages from a VisualWorks application is to simply send email to a provider that forwards the email to your cell phone. See my previous blog for an example of SMTP in VW.

One such provider is Verizon Wireless. Email sent to yourPhoneNumber@vtext.com will get forwarded. Messages are truncated to 250 characters and attachments are of course ignored. I figured that most cell phone providers would have similar service but from a quick look it seems that most have web interfaces but not many an email interface. However, there are companies out there that offer the service. One such company is www.ipipi.com. What is interesting about them is that email will be forwarded to your cell phone depending on rules that are setup.

We plan to shortly be able to alert our users of production issues via text messaging by leveraging SMTP in VisualWorks.

Staying ahead of trouble

The other day I decided to play with the idea of facilitating the notification of issues back to us. Our users are off-site.. So I decided to hook up to the SMTP capabilities of VW. As a proof of concept, I decided to modify the Notifier so that instead of providing a “copy stack” button it provides a “Send Stack” button. This is pretty easy to do by simply overriding:

DebuggerService>>>
openDebugger: aDebugger contents: aString1 label: aString2 proceed: mayProceed displayAt: aPoint

it will be quite apparent where to make the mods.

I then use MailMessage to send an email to my work account as well as to my cell phone. It is a simple as this:

| message smtpClient |
message := MailMessage newTextPlain.
message from: 'santa@northpole.net';
to: 'timmy@yourmail.net';
subject: 'Start making your list now';
text: 'What would you like for Christmas?'.
smtpClient := SimpleSMTPClient host: 'smtp.northpole.net'.
smtpClient sendMessage: message.

The above is straight from the VisualWork’s documentation. Messages can also carry attachments. For more info check out the NetClientDevGuide.pdf which comes with the VisualWorks Cincom distribution.

The overriding need is not for bugs per se but rather for production events such as abnormal termination of batch jobs etc. My plan is to make the application much more aware and responsive of runtime issues. Partly by perhaps incorporating VW’s SNMP framework but also by simply more carefully tracking runtime events in the daily business cycle.

SMTP seems like a reasonable viable possibility. Mail messages can of course be sent programatically. The question is whether the users will feel this to be a security risk. We should be able to encrypt mail. Well, we shall see how this turns out.