Products Downloads


French version


 

 

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,
  • Mobile client,
  • Mobile server,
  • Java client,
  • Java server,
  • Adelia Web client,
  • Adelia Cloud 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.

html

0/1

Code the message text in HTML format.

mime

0/1

Code the message in MIME format.

Java: not supported (messages are always coded in MIME format).

Windows, Mobile: Forced MIME encoding if the message includes attachments.

encoding-utf-8

0/1

Code the message in UTF-8 format.

Java: requires JavaMail version 1.4 or later.

With earlier versions, you can use the Java command's Dmail.mime.charset=utf-8" option to force unicode encoding.

connection-type

0/1/2

Type of secure connection.

0: insecure connection

1: connection via SSL (port 465 by default)

2: connection via the STARTLS command

NB: the ssl=1 parameter is supported for backward compatibility, it is the same as connection-type=1.

 

Java:

    • the use of the SSL connection requires JAVAMAIL 1.4 or above
    • the use of the STARTLS command requires JAVAMAIL 1.4.2 or above
    • the version of JAVAMAIL included with Adelia runtime is the latest version, which at the time of writing is version 1.5.1.
    • If you work with an SMTP server which does not support the TLSv1 protocol (protocol used by JAVAMAIL by default), other protocols may be enabled by defining the "mail.smtp.ssl.protocols" variable on the command line.
      For example, to enable SSL3, add Dmail.smtp.ssl.protocols="SSLv3 TLSv1" to the JAVA command line.

Mobile: secure connection is not supported.

priority

0/1/2/3

Message priority.

  • 0 : Unspecified
  • 1 : Low
  • 2 : Normal
  • 3 : High

helo-host

host name

Host name sent to the SMTP server (HELO / EHLO commands). It is by default the host name of the machine that executes the function.

ack

0/1

Request an acknowledgement of receipt (see notes below).

dsn

0/1

Request notification on the message's delivery status (see notes below).

logfile

' '

Name of a log file that displays the contents of the exchange with the SMTP server.

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

 

↑ Top of page

  • Aucune étiquette