SendMail
SendMail[body]
sends mail consisting of body to the address specified by $WolframID.
SendMail[{"subject"}]
sends mail with the specified subject and no body.
SendMail[{"subject",body}]
sends mail with the specified subject and body.
SendMail[{"subject",body,att}]
sends mail with the attachment or attachments att.
SendMail["to",content]
sends mail to the specified To: address.
SendMail[{"to1","to2",…},content]
sends mail to multiple To: addresses.
SendMail[{{"to1",…},{"cc1",…}},content]
includes the cci as Cc: addresses.
SendMail[{{"to1",…},{"cc1",…},{"bcc1",…}},content]
also includes the bcci as Bcc: addresses.
SendMail[assoc]
sends mail with elements specified in the association assoc.
Details and Options
- Email addresses are given as strings.
- The message body can be a string, an expression, or a list of expressions.
- SendMail automatically embeds graphics and typeset expressions as raster image files. It embeds sounds as audio files. It also embeds symbolic XML as XML files.
- SendMail uses appropriate encodings to handle any special characters that appear in a message.
- On desktop systems, SendMail requires certain user mail settings. These can be defined through Preferences ▶ Internet & Mail ▶ Mail Settings in the notebook front end or by using SetOptions[SendMail,MailSettings]. SendMail will attempt to send email via the Wolfram Cloud if these settings have not been provided. »
- In the Wolfram Cloud, emails are always relayed from the Wolfram Cloud server.
- In SendMail[assoc], the association assoc can include the following basic elements:
-
"To" {} email addresses of primary recipients "Cc" {} email addresses of secondary recipients "Bcc" {} email addresses of hidden recipients "Subject" None message subject line "Body" None message body "AttachedExpressions" {} expressions to send as attachments "AttachedFiles" {} files to send as attachments - The association assoc can contain the following additional elements, which can also be given in the setting for the option MailSettings:
-
"AutoBcc" None automatic hidden recipients "AutoCc" None automatic secondary recipients "FromAddress" Automatic sender's email address "FromName" None sender's full name "ReplyTo" None suggested address for replies "ReplyToMessageID" None ID of message to which this replies "Signature" None text to be appended at the end of body - The following elements related to the mail connection can also be given in the association assoc, and in the settings for MailSettings:
-
"EncryptionProtocol" None email encryption protocol "Password" Automatic user password "PortNumber" Automatic server port number or numbers "Server" Automatic server host name or IP address "ServerAuthentication" Automatic whether and how to verify server certificates "UserName" $UserName user login name - Possible settings for "EncryptionProtocol" include "SSL", "StartTLS", "TLS", and None.
- "Password" is typically set to None if no password authentication is required, or to Automatic if the password is to be entered in an interactive dialog. The password can also be given as a plain text string.
- Email credentials can be optionally stored via the "Password" interactive dialog. The credentials are encrypted using keys stored on your computer's hard drive. The encrypted credentials will be transmitted to the Wolfram Cloud and may only be accessed after you have authenticated using your Wolfram ID.
- SendMail has the following options:
-
MailAddressValidation Automatic function for address validation MailSettings Automatic an association of mail settings - The setting for MailAddressValidation is applied to all sender and recipient email addresses. If validation fails for any address, SendMail will not send any message.
- SendMail returns a unique message identification string upon success and a Failure object otherwise.
Examples
open allclose allBasic Examples (3)
Send email with the specified body to $WolframID:
Send email with the specified subject to $WolframID:
Scope (10)
See Also
SendMessage ServiceExecute Export Run RunProcess $WolframID MailReceiverFunction