File Submitter: 123
File Submitted: 15 May 2010
File Category: Premise
Contact: PM me
SSMTP is a driver that provides a convenient means to send email via Secure SMTP. It offers the following conveniences:
SSMTP relies on Collaborative Data Objects (CDO) in order to send email using Secure Socketsw Layer (SSL). In addition, SSMTP supports authentication which, together with SSL, ia required if you wish to send email via Google's Gmail service.
The SSMTP is a custom device driver so it resides in Devices > CustomDevices > SSMTP. Let's say you've preconfigured it to send email, via Gmail (smtp.gmail.com), to your phone. If you ever need to change the destination or carrier, you don't need to modify every script that sends email, you simply change it in the SSMTP device.
SSMTP can be preconfigured with default values. For example, it can be configured to send email via your Gmail account to you and your spouse. As a result, email scripts are simplified because you only need to specify a Subject and Body. Other properties such as From, To, MailServer, Account, Password, etc are all predefined by you. Here's a sample email script that relies on a preconfigured SSMTP device:
with Device.CustomDevices.SSMTP .Subject = "Warning: Garage Door left open." .MailHTMLBody = "Garage door left open:" & now .MailSend = true end with
Your script can override a default value and specify a unique one. After the email is sent, the default values are automatically restored. For example, the following script overrides MailTo's default value. After the message is processed, MailTo will be restored to its default value.
with Device.CustomDevices.SSMTP .Subject = "Warning: Garage Door left open." .MailTo = "[email protected], [email protected]" .MailHTMLBody = "Garage door left open:" & now .MailSend = true end with
SSMTP keeps a record of the last five email messages. The message's Status property will indicate the transmission time or, if a problem was encountered, the cause of the failure.
Using Builder, import the attached XDO file.
- In the Shortcut bar, click Modules.
- In the Explorer window, navigate to Modules > SSMTP > Classes > SSMTP
- Click the MailFrom property.
- In the Properties window, locate and set MailFrom's default value.
- Repeat this procedure for MailTo.
- In the Explorer window, navigate to Modules > SSMTP > Classes > SSMTPConfiguration
- Click the SMTPServer property.
- In the Properties window, locate and set SMTPServer's default value.
- Repeat this procedure for all other SMTP properties.
- In the Shortcut bar, click Devices.
- In the Explorer window, right-click Devices > CustomDevices and select New > SSMTP. An SSMTP device will appear in the list containing properties with the default values you've chosen.
Here's a script fragment that emails CallerID information.
with Devices.CustomDevices.SSMTP .MailSubject = "Telephone call: " & this.CallerIDName & ", " & this.CallerIDNumber .MailHTMLBody = "<b>Name: </b>" & this.CallerIDName & "<br>" & _ "<b>Number: </b>" & this.CallerIDNumber & "<br>" & _ "<b>Time: </b>" & this.CallerIDDateTime & "<br>" & _ "<b>CallsAway: </b>" & this.CallsAway & "<br>" .MailSend = true end with
- The fully-qualified email format is (for multiple recipients): "John" <[email protected]>, "Mary" <[email protected]>
- The simplest email format is (for multiple recipients): [email protected], [email protected]
- Email messages typically contain content in two forms, in HTML and in text-only. It is preferable to use the MailHTMLBody property instead of MailTextBody. The driver will automatically strip the HTML tags from MailHTMLBody and use that to populate the MailTextBody property. If you do use MailTextBody, the driver will simply copy its contents to MailHTMLBody (without HTML tags).
Click here to download this file