ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Rich Text Area control
  • Managing the error when sending an email via the POP3 protocol
EmailMsgError (Example)
Managing the error when sending an email via the POP3 protocol
The following code is used to send an email via the POP3 protocol. The characteristics of the POP3 protocol have been specified by EmailStartSession (address of the POP3 server, address of the SMTP server, etc.).
If an error occurs, the full error message is displayed. The session is closed when the email is sent.
// Start the email session
IF EmailStartSession(USER, PASSWORD, "pop3.ifrance.fr", "smtp.ifrance.fr") = True THEN
  UserName = USER
ELSE
  UserName = ""
  Error("Unable to establish the connection")
END
// Initializes the components of the email
Email.Sender = "<user@pcsoft.fr>" // The sender
Email.Recipient[1] = RECIPIENT // The recipient
Email.NbRecipient = 1     // The number of recipients
Email.Subject = SUBJECT          // The subject
Email.Message = TEXT        // The body of the message
Email.NbAttach = 0          // The number of attachments
// Send the email
IF EmailSendMessage(UserName) = False THEN
  Error(EmailMsgError(Email.Error))
END
...
EmailCloseSession(UserName)
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help