PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
New WINDEV, WEBDEV and WINDEV Mobile 26 feature!
  • Asynchronous mode
  • Progress Bar
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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:
AndroidAndroid Widget iPhone/iPadUniversal Windows 10 AppJava In this version, the emails can be sent via the SMTP protocol only.
PHP In this version, the emails can be sent via the SMTP protocol only. Before sending this email, there is no need to start a session with <EmailSMTPSession variable>.StartSession. To actually send the email, the SMTP server to use must be supplied to the PHP engine. It must be specified in the "SMTP =" entry of PHP.INI file.
Versions 17 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
New in version 22
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Example
WINDEVWEBDEV - Server codeReports and QueriesAndroidAndroid Widget iPhone/iPadUniversal Windows 10 AppWindows MobileAjaxUser 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 the details of 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:
PHP This parameter is not available.
<Email>: Optional Email variable
Versions 15 and later
Name of the Email variable corresponding to the email to send. If this parameter is not specified, the information found in the Email structure is used.
JavaPHP This parameter is not available.
New in version 15
Name of the Email variable corresponding to the email to send. If this parameter is not specified, the information found in the Email structure is used.
JavaPHP This parameter is not available.
Name of the Email variable corresponding to the email to send. If this parameter is not specified, the information found in the Email structure is used.
JavaPHP This parameter is not available.
<Advanced options>: Optional Integer constant
Combination of following constants:
Versions 15 and later
emailOptionEncodeHeader
New in version 15
emailOptionEncodeHeader
emailOptionEncodeHeader
Encodes 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.
PHP This parameter is not available.
Remarks
WEBDEV - Server codeAjax

Asynchronous mode

If the session was started in asynchronous mode (<EmailSMTPSession variable>.StartSession and EmailStartSMTPSession), <emailSMTPSession variable>.SendMessage creates an identifier for each email sent.
The email identifier is stored in the Email.MailIdentifier variable and can be used by EmailStatus to determine the current status of the outgoing email (sent, in progress, etc.).
Processing the errors in asynchronous mode: <emailSMTPSession variable>.SendMessage returns True if the email is placed in the email spooler, False if the spooler cannot be contacted. To find out whether the email was sent, you must use EmailStatus.
WINDEVReports and QueriesAndroidAndroid Widget iPhone/iPadUniversal Windows 10 AppWindows MobileUser code (UMC)

Progress Bar

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