Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

How do I add an href to email?

( #168943=categorized question: print w/ replies, xml ) Need Help??
Contributed by Marza on May 24, 2002 at 00:39 UTC
Q&A  > mail and news


Description:

I am writing a superdat notifier and I would like a reference link on where a person can click and get a file

The link in question is huge:

http://a64.g.akamai.net/7/64/2015/2002-05-22-11-03-36-300/download.nai.com/products/licensed/superdat/english/intel/sdat4204.exe

Obviously I would like a reference to it

This is what I have tried

$msg .= "Network Associates SuperDat: "; $msg .= "<A HREF=" ; $msg .= "$basePage->{exeUrl}"; # this is the huge link $msg .= ">SuperDat"; $msg .= '</A>';

Actually I have tried many things but the same giant line comes up. Forgive my lack of HTML knowledge but what can I do/look at?

Thank you for looking

Answer: How do I add an href to email?
contributed by CiceroLove

What you are wanting to do is make a multi-part MIME message which is too complicated to go into here. Just google multipart MIME message and there will be all sorts of tutorials for it. Basically, you can't just use HTML tags and hope they work. You have to hold the email clients hand through the whole thing and send boundaries so it knows how to render it. Keep in mind that some people (like me) don't allow HTML formatting in email and I will see the href anyway.

Answer: How do I add an href to email?
contributed by Joost

1. If you just want to send HTML email (and accept that some clients will not like this at all), you can turn your mail into an html page by stating:

Content-type: text/html
In you mail header.

2. If you want to be more compatible, you might compose an email with different attachments using MIME::Lite - it is (IMHO) the easiest to use module for creating complex messages.

3. You could also make a CGI script that sits on a short url, gets an id and refers to the longer url, eliminating the need for HTML :-)

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (13)
    As of 2014-12-18 13:33 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (51 votes), past polls