Jump to content


Submitter

SUPPORT TOPIC File Information

  • Submitted: May 15 2010 08:31 PM
  • Last Updated: May 15 2010 08:31 PM
  • File Size: 4.98K
  • Views: 2127
  • Downloads: 52
  • Author: 123
  • Contact: PM me

Download Module: SSMTP - Send email using SSL.

- - - - -



SSMTP is a driver that provides a convenient means to send email via Secure SMTP.  It offers the following conveniences:

Secure SMTP
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.

Centralized device
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.

Default values
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

Auto-reset
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

MailLog
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.

Installation
Using Builder, import the attached XDO file.

Configuration
  • 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.

Usage
Here's a script fragment that emails CallerID information.
with Devices.CustomDevices.SSMTP
				.MailSubject = "Telephone call: " & this.CallerIDName & ", " & this.CallerIDNumber
				.MailHTMLBody = "<b>Name:&nbsp;</b>" & this.CallerIDName & "<br>" & _
								"<b>Number:&nbsp;</b>" & this.CallerIDNumber & "<br>"  & _
								"<b>Time:&nbsp;</b>" & this.CallerIDDateTime & "<br>"  & _
								"<b>CallsAway:&nbsp;</b>" & this.CallsAway & "<br>" 
				.MailSend = true
			end with

Notes
  • 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).




Other files you may be interested in ..





  • 157 Total Files
  • 8 Total Categories
  • 25 Total Authors
  • 19396 Total Downloads
  • Premise Web Services Latest File
  • John in VA Latest Submitter

1 user(s) are online (in the past 15 minutes)

0 members, 1 guests, 0 anonymous users