Syntax and Parameters

EMAILX is called using the following syntax:

xcall EMAILX, opflags, cfgfile, to, header, body, status {,from, attachments, signature, errmsg, socket, server, host, username, password}

Parameter

Description

opflags

Operation flags

cfgfile

Name of configuration file

to

Address of recipient(s)

header

Header fields

body

Text of message

status

Return code

from

Email address of sender

attachments

Attachments

signature

(string) AMOS or native filespec to be appended to bottom of message body. Like body, signature can also contain the actual text rather than a filename. See note below.

errmsg

(string) If present, will receive a (possibly) useful text string if STATUS # 0 (elaborating on the error condition.).

socket

(numeric) Ignored on input unless you use opflags to avoid opening and closing the SMTP session for each message; in which case it receives the socket # of the session on the open call and must be passed to all the subsequent calls. Note that you must manually close the socket if you use the EMF'LEAVEOPEN option.

server

(string) Name or IP address of the SMTP server. (append :<port> if not using port 25). See note below.

host

(string) Name to identify your domain to the SMTP server in the initial protocol exchange with the SMTP server. See note below.

username

(string) Overrides the username field in the configuration file to specify the user name needed to authenticate with the SMTP server. If username and password are both specified (and not blank) and no AUTH mode was specified, AUTH = AUTO is used automatically.

password

(string) Overrides the password field in the configuration file to specify the password needed to authenticate with the SMTP server. If username and password are both specified (and not blank) and no AUTH mode was specified, AUTH = AUTO is used automatically. Note that the password may be specified in encrypted form (provided it was encrypted with MX_PWCRYPT).

 

Note that if values for signature, server and host are not specified explicitly, the values for those parameters will be taken from the configuration file. If no host is provided, we use nothing, which may lead to your mail being rejected, or possibly sent with a warning that it comes from an unidentified source.