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$
  • 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 Jun 12 '17 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 Jun 12 '17 at 17:31
1
$\begingroup$

This works for me:

SendMail[<|
  "To" -> "xyz@somewhere.com",
  "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, privacy policy and cookie policy

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