SENDMAIL        Send an e-mail message

Top  Previous  Next

Syntax:

SENDMAIL

[ server ] [ to name ] [ to email ] [ /options ]

Arguments:

[ server ]

Variable or string defining the server URL or IP address (e.g., smtp.mail.server or 209.198.128.17) of a SMTP mail server; the server port is always set to 25

 

[ to name ]

Variable or string defining the recipient

 

[ to email ]

Variable or string defining e-mail address recipient

Options:

/pw=xx

Define optional password to use when logging on to the mail server (omit if not required by the SMTP server)

 

/user=xx

Define optional user name to use when logging on to the mail server (omit if not required by the SMTP server)

 

/timeout=nn

Time-out, in seconds, to wait for message to be sent (if omitted the time-out is set to 30 seconds)

 

 

This command sends an e-mail message previously created with the CREATEMAIL command via a SMTP e-mail server. All of the arguments to this command are required, however [ to name ] may be an empty string.

 

The same message is sent each time SENDMAIL is called unless CREATEMAIL is called again to change the message.

 

Consider the following example where an e-mail message is created and then sent.

 

;; create the message

SET from = "Serengeti Sales"

SET email = "[email protected]"

SET subj = "Thanks for your order!"

SET body = "We appreciate your business."

SET attach = ""

CREATEMAIL from email subj body attach

;; send the message

SENDMAIL "120.33.13.10" "Joe Blow" "[email protected]"

 

Consider the following example where authentication is required on the SMTP server.

 

SET server = "smtp.mail.server"

SET to = "Ray Johnson"

SET email = "[email protected]"

SENDMAIL server to email /user=smtpid /pw=smtppw

 

Related Command(s): CREATEMAIL, GETMAIL