ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Managing emails
  • The email structure
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 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. For more details, see Writing an email.
Note The full description of an Email is given in the Internet standard reference documents: RFC822 and RFC2045 to RFC2049. These documents are available on Internet (use a search engine with the references of the documents).
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.
// Initialisation de la structure email
Email.NbRecipient = 1
Email.Recipient = "support_test@pcsoft_test.fr"
Email.Sender = "client@societe.fr"
Email.Message = "Test Auto eMail"

// Construction du message
IF EmailBuildSource() = False THEN
	Error(ErrorInfo())
	RETURN
END

IF fSaveText("C:\MesEmails\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 get more details on the error, use ErrorInfo with the errMessage constant.
<Username>: Character string
Identifies the user session. Corresponds to the username that was used to start the email session (EmailStartSession).
<File name>: Character string
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.
Note For more details on the Email structure, see The email structure.
Component: wd300com.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help