4
$\begingroup$

I want to send an email message containing a URL.

My first try:

SendMail[email, 
  {subject, "This is my <a href=\"http://www.wolfram.com\">url</a>."}]

My second try:

SendMail[email, 
  {subject, 
    Row[{"This is my ", Hyperlink["url", "http://www.wolfram.com"], "."}]}]

Both failed. When I am sending such messages, the message body will be attached files. Is there a work-around that can implement it? I want the message to include the hyperlink.

$\endgroup$
2
  • 1
    $\begingroup$ Perhaps related: Send HTML tables with SendMail. In particular, the comment about SendMail always adding a text/plain section at the beginning of the mail which, I wonder, might be a problem if you try to include an HTML body. $\endgroup$
    – MarcoB
    Commented Jun 12, 2017 at 16:19
  • $\begingroup$ @MarcoB I'm sorry,hard to understand for me.I don't know how to add that text/plain.Could you help to post it as an complete answer? $\endgroup$
    – yode
    Commented Jun 12, 2017 at 17:31

1 Answer 1

1
$\begingroup$

This works for me:

SendMail[<|
  "To" -> "[email protected]",
  "Subject" -> "Test",
  "Body" -> "Here is a link: http://www.wolfram.com.">
]

When I send these to myself I get an email with a working link. (I am using mail.app on a mac.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.