This function can be used to send an email message via an SMTP server (internet). It implements the standard features found in any email application (e.g. send to one or more addressees, in CC or BCC mode, including one or more attachments, etc.).
Prerequisites
For the Java version, the following javamail files must be included in the execution context:
- activation.jar,
- mail.jar.
These files are included in some versions of Tomcat 4.1 and Websphere 5.
Context
- Windows client,
- Windows server,
- Java client,
- Java server,
- Adelia Web client,
- Adelia Cloud client
- Event Adelia client.
Parameters
ALPHA(n) |
Server |
SMTP server host name - optionally followed by the connection port (e.g. smtp.free.fr, smtp.free.fr:25). If the connection port is not specified, a default value is used (25 in normal mode, and 465 in SSL mode). |
ALPHA(n) |
User |
User name. |
ALPHA(n) |
Password |
User's password. |
ALPHA(n) |
Sender |
Sender's name. |
ALPHA(n) |
Addressees |
Main addressees (To). List of email addresses separated with ';' characters. |
ALPHA(n) |
Copies |
Carbon copy (Cc) addressees. List of email addresses separated with ';' characters. |
ALPHA(n) |
Bcopies |
Blind copy (Bcc) addressees. List of email addresses separated with ';' characters. |
ALPHA(n) |
Attachments |
File attachments. List of filenames separated with ';' characters. |
ALPHA(n) |
Subject |
Message subject. |
ALPHA(n) |
Body |
Message body text. |
ALPHA(n) |
Options |
Options. List of "option=value" pairs, separated with ';' characters. The possible options are described later. |
ALPHA(250) |
Status |
Operation status: *BLANK if the operation was completed successfully. If it was not, this field contains an error message to help identify the cause of the error. |
Note: The only output parameter is the operation status (final parameter).
Note on user authentication:
The authentication mode is detected automatically if the profile and password are specified. There are certain restrictions, however:
- The Mobile version only supports simple (unsecured – PLAIN and login) authentication modes.
- Only the Windows version supports NTLM authentication.
- TLS encryption is not generally supported.
Notes on acknowledgements of receipt and delivery status notifications:
- Acknowledgements of receipt and message delivery status notifications are sent via email to the address specified in the email's "From:" field. This address must therefore be valid if you want to receive acknowledgements.
- The acknowledgement of receipt is a request sent in the email, handled by the recipient's email client.
Depending on the email client used and its configuration, the reply can be automatic, left to the recipient's discretion, or simply ignored. Receiving an acknowledgement implies that the recipient has opened the email, however, not receiving one does not necessarily mean that the email has not been read. - The delivery notification is managed directly by the SMTP server. Reliable information will only be received if this function is supported by all the SMTP relays which the message passes through.
If any of the relay servers does not support this function, partial information should be received (a message relayed up to the "domain"). If the SMTP server specified on sending does not support the function, no information will be received.
Example
ALPHA(50) |
Server |
ALPHA(50) |
User |
ALPHA(50) |
Password |
ALPHA(50) |
Subject |
ALPHA(50) |
Body |
ALPHA(50) |
From |
ALPHA(250) |
To |
ALPHA(250) |
CC |
ALPHA(250) |
BCC |
ALPHA(250) |
Attachments |
ALPHA(250) |
Options |
ALPHA(250) |
Status |
|
|
Server |
= 'mailhost.hardis.fr' |
User |
= 'JDupont' |
Password |
= 'pwddupont' |
From |
= 'jean.dupont@hardis.fr' |
To |
= 'pierre.durand@paris.fr' |
CC |
= 'david.ludo@hardis.fr;eric.martin@paris.fr' |
BCC |
= 'claude.dupond@hardis.fr' |
Attachments |
= 'd:\mypicture1.jpg; d:\mypicture2.jpg ' |
Subject |
= 'This is an example' |
Body |
= '<html><head/><body><b>This is the body of my sample e-mail message</b></body></html>' |
Options |
= 'html=1' |
CALL_DLL 'VaToolBx' 'VaToolBxSendMailSMTP' Server User Password From To Cc Bcc Attachments Subjet Body Options Status |
List of the VaToolBx functions by topic