JVCL Help:TJvMail.SendMail
JVCL Help: TJvMail.SendMail Method
Search in JVCL Help
Search in all projectsSummary
Sends a message.
Pascal
procedureSendMail(ShowDialog: Boolean = True);
Parameters
Parameters | Description |
ShowDialog: Boolean = True | Specifies whether to display a dialog box to prompt the user for recipients and other sending options. When ShowDialog is set to false, at least one recipient must be specified. |
Description
Call SendMail to send a standard message, with or without any user interaction. The profile must be configured so that SendMail can open the default service providers without requiring user interaction. But if loNewSession is included in LogonOptions (thus disallowing the use of a shared session) and the profile requires a password, then loLogonUI must be set or the function will fail. Avoid this situation by using an explicit profile without a password or by using the default profile without a password. Use property SimpleMAPI to retrieve a default profile.
You can provide a full or partial list of recipient names, subject text, file attachments, or message text. If any information is missing, SendMail can prompt the user for it. If no information is missing, either the message can be sent as is or the user can be prompted to verify the information, changing values if necessary.
A successful return from SendMail does not necessarily imply recipient validation. The message might not have been sent to all recipients. Depending on the transport provider, recipient validation can be a lengthy process.
Applications that send messages to custom recipients (i.e., recipients not listed in the address book) can avoid name resolution by setting the Address property of the recipient TJvMailRecipient object to the custom address.
The following example sets the values of properties of a TJvMail object, and then calls SendMail.JvMail1.Clear;
JvMail1.Recipient.AddRecipient(ToEdit.Text);
JvMail1.Subject := SubjectEdit.Text;
JvMail1.Body.Text := BodyEdit.Text;
JvMail1.Attachment.Assign(AttachmentMemo.Lines);
JvMail1.SendMail;
About
Contribute to this help topic
This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page