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 as Cc: addresses.

SendMail[{{"to1",},{"cc1",},{"bcc1",}},content]
also includes the as Bcc: addresses.

SendMail[recipients,content,opts]
uses the options opts.

SendMail[assoc]
sends mail with elements specified in the association assoc.

Details and OptionsDetails 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 in the notebook front end or by using SetOptions[SendMail,]. »
  • Mail settings are stored so as to be consistent across sessions.
  • Mail settings can also be given explicitly as options in SendMail.
  • In the Wolfram Cloud, default mail settings are automatically set up from user account information.
  • The following elements can be used to specify mail to send:
  • "To"{}email addresses of primary recipients
    "Cc"{}email addresses of secondary recipients
    "Bcc"{}email addresses of hidden recipients
    "Subject"Nonemessage subject line
    "Body"Nonemessage body
    "Attachments"{}attachments, given as a list of filenames
  • These elements can appear either in options or in associations in SendMail[assoc] or SendMail[recipients,content].
  • The following elements specify required settings:
  • "From"sender's email address
    "Server"server host name or IP address
  • Additional settings include:
  • "EncryptionProtocol"Noneemail encryption protocol
    "FullName"Nonesender's full name
    "Password"Noneuser password
    "PortNumber"Automaticserver port number or numbers
    "ReplyTo"Nonesuggested address for replies
    "ServerAuthentication"Automaticwhether and how to verify server certificates
    "UserName"$UserNameuser login name
  • Possible settings for include , , , None.
  • 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 plaintext string.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Send email with the specified body to $WolframID:

In[2]:=
Click for copyable input
Out[2]=

Send email with the specified subject to $WolframID:

In[1]:=
Click for copyable input
Out[1]=

Send email to the specified recipient:

In[1]:=
Click for copyable input
Out[1]=

Specify recipients and content in options:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2008
(7.0)
| Updated in 2014
(10.0)