PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
This content has been translated automatically. Click here to view the French version.
  • The email structure
  • Asynchronous mode
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 via the SMTP protocol while controlling the "buffer" of the email.
This function is an advanced function used to entirely configure the email sent. This function must only be used to manage the specific emails not managed by EmailSendMessage. See Writing an email for more details.
Remark: The entire email description can be found in the reference documents of the Internet standard: RFC822 and RFC2045 to RFC2049. These documents are available on Internet (use a search engine with the references of the documents).
Versions 15 and later
You also have the ability to use the emailSMTPSession and Email variables as well as EmailImportSource to send a message while controlling the source of the message.
New in version 15
You also have the ability to use the emailSMTPSession and Email variables as well as EmailImportSource to send a message while controlling the source of the message.
You also have the ability to use the emailSMTPSession and Email variables as well as EmailImportSource to send a message while controlling the source of the message.
// Initialize the email structure
Email.NbRecipient = 1
Email.Recipient = "support_test@pcsoft_test.fr"
Email.Sender = "customer@company.fr"
Email.Message = "Auto Email Test"
 
// Build the message
IF EmailBuildSource() = False THEN
Error(ErrorInfo())
RETURN
END
 
IF fSaveText("C:\MesEmail with\ContenuEmail.txt", Email.Source) = False THEN
Error(ErrorInfo())
ELSE
EmailSend("SessionSMTP", "C:\MesEmails\ContenuEmail.txt")
IF ErrorOccurred = True THEN
Error(ErrorInfo())
END
END
END
Syntax
<Result> = EmailSend(<Username> , <File name>)
<Result>: Boolean
  • True if the function was successfully run,
  • False otherwise. To find out the name of the error, use the function ErrorInfo with the constant errMessage.
<Username>: Character string (with quotes)
Identifies the user session. Corresponds to the user name used to open the Email session (EmailStartSession function).
<File name>: Character string (with quotes)
Identifies the file containing the entire email formatted according to the parameters expected by the SMTP server.
Remarks

The email structure

When sending the email, only the variables of the email structure required by the SMTP protocol are taken into account. The other variables are ignored.
Remark: See The email structure for more details.
Ajax

Asynchronous mode

If the session was started in asynchronous mode (EmailStartSession and EmailStartSMTPSession), EmailSend creates an identifier for each email sent.
This identifier is stored in the Variable Email.mail identifier and can be used with the EmailStatus function to find out the current sending report of the Email.
Component: wd260com.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment