West Wind Internet Protocols 4.68 |
wwipstuff::sendmail
|
To send email set various property values and send the actual message. The following properties can be set.
cMailServer
The IP Address or domain name of the SMTP server that is responsible for sending the message. The server must support 'pure' SMTP mail services and must not require a login prior to sending messages.
cSendername
Display name of the person sending the message. This option is often overridden by the mail server with the actual user account, but some servers leave the name as set here.
cSenderEmail
The sender's Email address.
cRecipient
Either a single recipient email address or a list of comma delimited addresses. Limited to 1024 characters. To specify a name and email address use the following syntax (works for all Recipient and CC properties):
Joe Doe <jdoe@yourserver.com>
cCCList
Either a single CC recipient email address of a list of comma delimited addresses. Limited to 1024 characters.
cBCCList
Blind CCs are sent messages but do not show on the recipient or CC listing of the receiver. Limited to 1024 characters.
cSubject
The message subject or title.
cMessage
The actual message body text.
cAttachment
The name of the file that is to be attached to the message. This property must be filled with a valid path pointing at the file to attach. Multiple files can be attached by separating each file with a comma.
cContentType
Content type of the message allows you to send HTML messages for example. For HTML set the content type to text/html. Content types only work with text content types at this time since special encoding of the message text is not supported. All binary types should be sent as attachments.
cUsername, cPassword
If you are sending mail to a mail server that requires username and password authentication, set these properties. Only unencrypted, plain text communication is supported using the AUTH LOGIN command.
Syntax: |
o.sendmail() |
| Return: | .T. or .F. When .F. check cErrorMsg for error string. |
| Parameters: |
It's highly recommended you use the class property interface rather than the parameter interface. The parameter interface is still there, but no longer documented. See example. |
| Example: |
|
| Remarks: | To check for errors check the return value of the SendMail method. If the value is .F. check the cErrorMsg property for the error message. If you're sending plain text messages separate paragraphs with CHR(13) + CHR(10). Remember that if you send HTML you will need <br> and <p> tags to separate your lines (or use DisplayMemo() from wwUtils). SendMail works with pure SMTP servers and most ESMTP servers. However, some servers that don't properly support these interfaces may cause problems. SendMail does not support SSL based emails, and does not support encrypted authentication (only base64 encoded default authentication). Common ProblemsDue to email's potential as a weapon there are scenarios where mail servers and your computer might get in the way of sending emails. Relay Errors Anti-Virus Software or Firewall blocking |
See also: