|
|
|
|
|
- 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. Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
MonMessage is Email
MonMessage.Sender = sExpediteur
sDestinataire_1 is string = "aaa@gmail.com"
sDestinataire_2 is string = "bbb@gmail.com"
Add(MonMessage.Recipient, sDestinataire_1)
Add(MonMessage.Recipient, sDestinataire_2)
MonMessage.Subject = SAI_Sujet
MonMessage.Message = RTFToText(sNote)
MonMessage.HTML = RTFToHTML(sNote)
MaSession is emailSMTPSession
MaSession.ServerAddress = sServeur
IF EmailStartSession(MaSession) = False THEN RETURN
EmailSendMessage(MaSession, MonMessage, emailOptionEncodeHeader)
EmailCloseSession(MaSession)
Properties 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.Note: If the attachment is filled in manually, don't forget to specify the Nom property, otherwise the image will not be transmitted in the email.. Example: oEmail.Attach[1].Contenu = fLoadBuffer(fDataDir() +
["\"] + "Email\" + sLogoSociété)
oEmail.Attach[1].ContentType = "image/gif"
oEmail.Attach[1].Nom = "logo.gif"
| Bcc | Array of character strings | Contains the addresses of unofficial recipients: their names do not appear in the email received by official recipients (property Recipient). 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.Note: If one of the keywords contains special characters or accents, use the constant emailOptionEncodeEntête when sending the message with the EmailSendMessage function. | Cc | Array of character strings | Contains the addresses of recipients in copy: their names appear in the email received by official recipients (property Recipient). 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).Note: If the identifier contains special characters or accents, use the constant emailOptionEncodeEntête when sending the message with the EmailSendMessage function. | 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:- emailPriorityLow: used, for example, for very low-urgency emails.
- emailPriorityHigh: used, for example, for urgent emails.
- emailNormalPriority (default): used for non-urgent emails, for example.
| 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. Note: If the address contains special characters or accents, use the constant emailOptionEncodeEntête when sending the message with the EmailSendMessage function. | 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 email address. This address must be valid. A sender name can be given in addition to the email address.. This name will be displayed in priority to the email address in an email application or webmail.. This property then uses the following format: "<Nom> <adresse@domaine.com>" Note: If the sender contains special characters or accents, use the constant emailOptionEncodeEntête when sending the message with the EmailSendMessage function. | 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.Note: If the address contains special characters or accents, use the constant emailOptionEncodeEntête when sending the message with the EmailSendMessage function. | Sensitivity | Integer constant | Type of confidentiality for the email. The possible values are as follows:- emailConfidential: Used, for example, for emails sent within a company..
- emailNormal (Default): No confidentiality.
- emailPersonnel: Used, for example, for personal emails.
- emailPrivé: Used, for example, for private emails.
This property is not supported in Lotus Notes. | Signature | Integer constant | Status of email signature: - certificateExpired: Valid signature but certificate expired.
- certificateInvalid: Invalid signature or certificate.
- untrusted certificate: Valid signature but certificate's trusted root is untrusted.
- certificateOK: Reliable 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. Note: If the subject contains special characters or accents, use the constant emailOptionEncodeEntête when sending the message with the EmailSendMessage function. | Note: Non-Latin characters can be used in the following properties: Subject, Message, Category, Senderaddress, Sender, ID. In this case, use the constant emailOptionEncodeHeader when the message is sent by EmailSendMessage.Remarks 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 the last email received, depending on 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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|