ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Progress Bar
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Sends an email using the SMTP protocol: the email is sent directly to the server. The email is actually sent when disconnecting from the SMTP server (i.e. when the session is closed).
Attention: Before sending the email, it is necessary to:
AndroidAndroid Widget iPhone/iPad In this version, the emails can be sent via the SMTP protocol only.
Example
AndroidAndroid Widget iPhone/iPad Sending a message by SMTP
// Ouverture d'une session SMTP
MaSession is emailSMTPSession
MaSession.ServerAddress = "smtp.masociete.fr"
MaSession.OuvreSession()

// Construction d'un email
MonMessage is Email
MonMessage.Sender = "service_commande@masociete.fr"
MonMessage.Destinataire.Ajoute("client@societe.com")
MonMessage.Subject = SAI_SujetEmail
MonMessage.Message = SAI_TexteEmail

// Envoi du message
MaSession.EnvoieMessage(MonMessage)
Syntax

Sending an email using SMTP Hide the details

<Result> = <Session>.SendMessage([<Email> [, <Advanced options>]])
<Result>: Boolean
  • True if the message was sent to the SMTP server,
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Session>: Control name
Identifies the user session. Corresponds to:
<Email>: Optional Email variable
Name of the Email variable corresponding to the email to be sent. If this parameter is not specified, the information contained in the Email structure is used.
<Advanced options>: Optional Integer constant
Combination of following constants:
emailOptionEncodeHeaderEncodes the message headers in Quoted-Printable if necessary.
The headers of messages are not encoded by default. This constant prevents the reception of email with wrongly decoded accented characters.
emailOptionMessageIDTakes the Email.MessageID variable into account to generate the email. This option is ignored if this variable is not specified.
This option is an advanced option.
emailOptionReferenceTakes the Email.Reference variable into account to generate the email. This option is ignored if this variable is not specified.
This option is an advanced option.
Remarks
AndroidAndroid Widget iPhone/iPad

Progress Bar

To follow the sending progress, use EmailProgressBar.
Component: wd300com.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/23/2024

Send a report | Local help