Macro Scheduler 15

SMTPSendMail

SMTPSendMail>recipients,server,from_address,from_name,subject,body,attachments

 

Not supported in Macro Scheduler Lite.

 

Sends email via an SMTP server to the recipients entered.

 

recipients : Include one or more email addresses, separated by semicolons (;).

server : The name or IP address of your SMTP server.

from_address : Your email address, or the email address you want the message to come from.

from_name : Your real name, or a string to appear in the from name field.

subject : The subject line.

body : The body text of the message (default is text, to send HTML set SMTP_HTMLBODY to 1).

attachments : if sending files include each file separated by semicolons (;).  If no attachments end the line with a comma.

 

By default when this command is in use a small status window will appear at the top left of the screen.  You can stop this window being displayed by setting SENDMAIL_STATUS to 0.

 

To send HTML set SMTP_HTMLBODY to 1.

 

To include CC or BCC email addresses set the SMTP_CCLIST and SMTP_BCCLIST variables.  Separate multiple email address with semicolons.

 

If you are using an SMTP server that requires authentication, you can enable authentication by setting SMTP_AUTH to 1, and then setting SMTP_USERID and SMTP_PASSWORD to the username and password that you need to connect to the SMTP server.  e.g:

 

Let>SMTP_AUTH=1

Let>SMTP_USERID=myuser

Let>SMTP_PASSWORD=frogslegs

 

To enable return receipt of the email, set SMTP_RECEIPT to 1.

 

By default the port used by SMTPSendMail is 25.  If you need to change the port number set the value of SMTP_PORT.

 

The result of the sendmail operation is placed into the variable SMTP_RESULT.  The format of this response depends on the SMTP server being communicated with.  If successful the value will contain the result code 250.  Otherwise it will contain the appropriate error message.

 

SMTP_TIMEOUT can be used to set a connection timeout in milliseconds.  This timeout relates to the initial connection to the SMTP server.

 

To use SSL set SMTP_SSL to 1.  To use SSL you will first need to install the OpenSSL libraries.  See:

http://www.openssl.org/related/binaries.html and http://www.mjtnet.com/blog/2012/10/03/sendingretrieving-emails-via-gmail/

 

If TLS is needed you can set how it should be used by setting SMTP_USETLS as follows:

 

0

No TLS/SSL

Default - no encryption

1

Use Implicit TLS

You wish to use implicit TLS. In implicit TLS FTP, you connect to port 990, start TLS negotiation, and the entire session is encrypted. IETF has depreciated implicit TLS FTP so this setting should only be used with FTP servers that do not yet support explicit TLS.

2

Use Require TLS

You wish your session to use explicit TLS. In explicit TLS FTP, you connect to port 21 like the unencrypted version of FTP and encryption lasts until you disconnect. No attempt is made to continue the FTP session if TLS negotiation fails.

3

Use Explicit TLS

You wish your session to use explicit TLS if the FTP server supports it.

 

To set TLS version set TLS_VER to one of the following values:

 

1        TLS v1.0

11        TLS v1.1

12        TLS v1.2

 

Abbreviation : SMT

See also: RetrievePOP3

 

Example

 

Let>SENDMAIL_STATUS=1

Let>subject=Test Message

Let>[email protected]

Let>myname=Mr Smith

Let>[email protected];[email protected]

Input>body,Enter your message:

SMTPSendMail>recipients,post.mail.com,me,myname,subject,body,

Message>Result of SendMail: %SMTP_RESULT%