Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

You have a choice. Firstly, you can send a plain text attachment that contains the URL. As doward explained, most modern mail programs will recognise the the URL and turn it into a clickable link when the mail is displayed. In this case, your mail looks like this:

my $message_body = <<END_OF_BODY; This is a list of things to bring * Fresh flowers from Flowershop X http://www.example.com/flowers * Today's Arrangement instructions from instruction home page http://www.example.com/arrangement/ END_OF_BODY

That's the only way it can work in plain text. You can just include the URL and rely on the mail program to make it clickable.

Alternatively, you can create a HTML version of the mail which contains real <a> tags. In this case, your mail looks something like this:

my $message_body = <<END_OF_BODY; <p>This is a list of things to bring</p> <ul> <li>Fresh flowers from <a href="http://www.example.com/flowers/">Flowe +rshop X</a></li> <li>Today's Arrangement instructions from <a href="http://www.example. +com/arrangement/">instruction home page</a></li> </ul> END_OF_BODY

In this second example, you would need to set the content type of the attachment as 'text/html' so that the mail program that is displaying it knows how to treat it.

As several people have mentioned in this thread, if you want HTML mail, then the best approach is to have two attachments, one of which is an HTML version and the other of which is the plain text version. In this case, you need to find out how your Mail-building module of choice (and I can only repeat once more my recommendation for the Perl Email Project) builds MIME messages with more than one attachment.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg


In reply to Re^3: Inserting a hyperlink by davorg
in thread Inserting a hyperlink by rio

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-26 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found