ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Managing emails
  • Progress Bar
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Sends an email using SMTP: the email is directly sent to the server. The email is actually sent when disconnecting from the SMTP server (i.e. when the session is closed).
Caution: Before sending the email, you must:
Universal Windows 10 AppJava In this version, the emails can be sent via the SMTP protocol only.
Example
WINDEVUniversal Windows 10 AppUser code (UMC) Sending a message by SMTP
// Start an SMTP session
MySession is emailSMTPSession
MySession.ServerAddress = "smtp.mycompany.us"
MySession.StartSession()
 
// Build an email
MyMessage is Email
MyMessage.Sender = "ordering_department@mycompany.fr"
MyMessage.Recipient.Add("customer@company.com")
MyMessage.Subject = EDT_EmailSubject
MyMessage.Message = "EDT_EmailText"
 
// Send the message
MySession.SendMessage(MyMessage)
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.
Java If an error occurs, the content of Email.Error variable must be checked.
<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.
Java This parameter is not available.
<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
WINDEVUniversal Windows 10 AppUser code (UMC)

Progress Bar

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

Last update: 06/21/2023

Send a report | Local help