|
|
|
|
|
- Properties specific to Email variables
- Correspondence between the properties and the RFC standard
- WLanguage functions
Email (Variable type) In french: Email
The Email type is used to handle the email content as well as the associated information. You can define and change the characteristics of an email using different WLanguage properties. This type replaces and extends the Email structure by giving you the ability to handle several messages at the same time. Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
MyMessage is Email
MyMessage.Sender = sSender
sRecipient_1 is string = "aaa@gmail.com"
sRecipient_2 is string = "bbb@gmail.com"
Add(MyMessage.Recipient, sRecipient_1)
Add(MyMessage.Recipient, sRecipient_2)
MyMessage.Subject = EDT_Subject
MyMessage.Message = RTFToText(sNote)
MyMessage.HTML = RTFToHTML(sNote)
MySession is emailSMTPSession
MySession.ServerAddress = sServer
IF EmailStartSession(MySession) = False THEN RETURN
EmailSendMessage(MySession, MyMessage, emailOptionEncodeHeader)
EmailCloseSession(MySession)
Remarks Properties specific to Email variables The following properties can be used to handle Email variables: | | | Name | Type used | Effect |
---|
AsynchronousEmailIdentifier | Character string | Email identifier (asynchronous mode only). WEBDEV only | Attach | Array of emailAttach | Contains the description of attached files. The number of attached files is unlimited. For more details, see emailAttach.Remark: If the file is attached manually, do not forget to specify the Name property, otherwise the image will not be sent along with the email. Example: oEmail.Attach[1].Content = fLoadBuffer(fDataDir() +
["\"] + "Email\" + sCompanyLogo)
oEmail.Attach[1].ContentType = "image/gif"
oEmail.Attach[1].Name = "logo.gif"
| Bcc | Array of character strings | Contains the addresses of non-official recipients: their name is not displayed in the email received by the official recipients (Recipient property). The addresses are limited to 127 characters. The number of non-official recipients is limited to 200. This limit can be exceeded in SMTP mode. However, some servers do not support the emails with an important number of recipients. | Category | Character string | List of keywords associated with the email. The keywords are separated by semicolons.Remark: If one of the keywords contains special characters or accented characters, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage. | Cc | Array of character strings | Contains the addresses of recipients in copy: their name is displayed in the email received by the official recipients (Recipient property). The addresses are limited to 127 characters. The number of recipients in copy is limited to 200. This limit can be exceeded in SMTP mode. However, some servers do not support the emails with an important number of recipients. | Certificate | Certificate | Certificate used to sign the email (header, content and attachments) before sending it. | DispositionNotification | Boolean | Outbound, used to request a confirmation that the email was read by the recipient (True). The recipient does not necessarily have to send a read receipt. Inbound, used to find out whether a read receipt was requested by the sender (True) or not. If a read receipt is requested, it has priority over the delivery receipt. This property is set to False by default. This property is supported by Outlook in Windows. | Header | Array of emailHeader | Headers of email. | HTML | Character string | Message with HTML formatting. Limited to 4 GB. This property is supported in POP3/SMTP only. | ID | Character string | Unique email identifier. This identifier remains constant for the entire email lifetime. This identifier is initialized when sending the email (EmailSendMessage).Remark: If the identifier contains special characters or accented characters, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage. | Message | Character string | Text of message (with simple text formatting). Limited to 2 GB (64 KB for Lotus Notes). Remarks: - If the message contains special characters or accented characters, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage.
- It is recommended not to exceed 98 characters per line in the body of the message. If a line exceeds 98 characters, the message may be classified as spam.
| MessageID | Character string | Unique email identifier. This identifier remains constant for the entire email lifetime. This identifier is used to follow a conversation.
When sending an email, this variable specifies the email identifier. If this variable corresponds to an empty string, the identifier will be given by the server. The application that generates the identifier must check whether this identifier is unique.
When receiving an email, this variable specifies the email identifier.
This identifier must have the following format: <Identifier@domain>. For example: 1@192.168.2.210
| Out | Boolean | Specifies whether a message was read on the server: - False if the message was read.
- True if the message was not read.
| PlainText | Character string | Plain text of message. This variable is available for the incoming emails only. | Priority | Integer constant | Type of priority for the email. The possible values are as follows:- emailLowPriority: used for the really non-urgent emails.
- emailHighPriority: used for the urgent emails.
- emailNormalPriority (Default value): used for the non-urgent emails.
| ReceiveDate | Character string or DateTime variable | Date when the message was received. | Recipient | Array of character strings | Contains the addresses of main recipients. The number of recipients is limited to 20. This limit can be exceeded in SMTP mode. However, some servers do not support the emails with an important number of recipients. | Reference | Character string | Unique identifier of one or more reference emails linked to the current conversation.
| ReturnAddressError | Character string | Return address if an error occurred. This address is managed by the POP3, IMAP and SMTP protocols. For more details, see Correspondence between the properties and the RFC standard. Remark: If the address contains special characters or accented characters, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage. | ReturnReceipt | Boolean | Outbound, used to request a delivery receipt from the recipient (True). The recipient does not necessarily have to send a delivery receipt. Inbound, used to find out whether a delivery receipt was requested by the sender (True) or no (False).
If a read receipt is requested, it has priority over the delivery receipt. This property is set to False by default. | Sender | Character string | Sender's address. This address must be a unique, valid email address. For more details, see Correspondence between the properties and the RFC standard.Remark: If the sender contains special characters or accented characters, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage. | SenderAddress | Character string | Address to which the answer to the message will be sent (up to 127 characters). Corresponds to Reply-To. For more details, see Correspondence between the properties and the RFC standard.Remark: If the address contains special characters or accented characters, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage. | Sensitivity | Integer constant | Type of confidentiality for the email. The possible values are as follows:- emailCompanyConfidential: Used for the in-house emails for example.
- emailNoSensitivity (Default value): No confidentiality.
- emailPersonal: Used for the personal emails for example.
- emailPrivate: Used for the private emails for example.
This property is not supported in Lotus Notes. | Signature | Integer constant | Status of email signature: - certificateExpired: Valid signature but expired certificate.
- certificateInvalid: Invalid signature or certificate.
- certificateUntrusted: Valid signature but untrusted certificate root.
- certificateOK: Trusted signature and certificate.
This property is read-only. | Source | Character string | Contains the source of incoming message (subject, sender, recipient, content, ...). | Subject | Character string | Message subject. Remark: If the subject contains special characters or accented characters, use the emailOptionEncodeHeader constant when the message is sent by EmailSendMessage. | Remark: You can use non-Latin characters in the following properties: Subject, Message, Category, SenderAddress, Sender, ID. In this case, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage.Correspondence between the properties and the RFC standard | | | | | | Version 23 and earlier | From version 24 | | Outgoing | Incoming | Outgoing | Incoming | From | Sender property | Populates the Sender property. | Sender property | Populates the Sender property. | Reply-To | SenderAddress property | Populates the SenderAddress property. | SenderAddress property | Populates the SenderAddress property. | Return-Path | SenderAddress property | Populates the SenderAddress property if "Reply-To" is empty. | ReturnAddressError property | Populates the ReturnAddressError property. | Return-Receipt-To (ReturnReceipt) | SenderAddress if specified, Sender property otherwise. | Sets the ReturnReceipt property to True if the received value is not empty. | SenderAddress if specified, Sender property otherwise. | Sets the ReturnReceipt property to True if the received value is not empty. | Disposition-Notification-To (DispositionNotification) | SenderAddress if specified, Sender property otherwise. | Sets the DispositionNotification property to True if the received value is not empty. | SenderAddress if specified, Sender property otherwise. | Sets the DispositionNotification property to True if the received value is not empty. |
WLanguage functions The following functions can be used to handle Email variables:
| | EmailBuildSource | Generates the source code of the email message to be sent from the variables in the Email structure or in an Email variable. | EmailChangeStatus | Changes the status of an email on a messaging server. | EmailCopy | Copies an email found in a directory to another directory of an IMAP server. | EmailDeleteMessage | Deletes the current email using the current protocol (POP3, IMAP, MS Exchange, Lotus Notes or Outlook). | EmailGetIndicator | Retrieves the indicators defined on an email of IMAP session. | EmailImportHTML | Imports, into the Email structure or into an Email variable, the content of an HTML file in order to send it by email. | EmailImportSource | Populates an Email variable using the content of its Source property or the different variables of the email structure using the content of the Email.Source variable. | EmailLoadAttachment | Adds an attached file to an email. | EmailReadFirst | Reads the first incoming email according to the protocol used (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook). | EmailReadFirstHeader | Reads the header of the first incoming email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook). | EmailReadLast | Reads the last incoming email according to the protocol used (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook). | EmailReadLastHeader | Reads the header of last incoming email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook). | EmailReadMessage | Reads an incoming according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook). | EmailReadMessageHeader | Reads the header of an incoming email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook). | EmailReadNext | Reads the incoming email found after the current email according to the protocol (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook). | EmailReadNextHeader | Reads the header of the email found after the current email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook). | EmailReadPrevious | Reads the email found before the current email according to the protocol used (POP3 or IMAP, MS Exchange, Lotus Notes or Outlook). | EmailReadPreviousHeader | Reads the header of the email found before the current email according to the protocol used (POP3 or IMAP, Lotus Notes or Outlook). | EmailReset | Resets all the variables of the email structure or all the variables of an Email variable. | EmailSeekFirst | Finds one or more emails according to the criteria specified in the messaging software (Outlook, messaging software using the IMAP protocol, ...). | EmailSeekFirstNotes | Seeks one or more emails according to specified criteria, in a local or remote Lotus Notes or Domino database. | EmailSendMessage | Sends an email using a given protocol (SMTP, MS Exchange, Lotus Notes, Outlook). |
Related Examples:
|
Complete examples (WINDEV): WD Mail
[ + ] This application is an email client developed in WINDEV. It is based on the Email objects. This email client is used to retrieve and send emails by using the POP, IMAP and SMTP protocols. You have the ability to apply filters to the incoming emails. The application can also be used to manage several email accounts. The writing of an email is based on the HTML edit control.
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|