Hi Monks,

WARNING ====> Depending on the solution, this might be more of an html question than a Mime::Lite question, but either way, i'm confident that you monks will know what I'm doing wrong here. I have never been disappointed by this site.

I am using Mime::Lite to email an html report which contains a hyperlink of text data. When a user clicks on the hyperlink, I want the text to be displayed in an appropriate OS application (in my case, it's Notepad). This seems simple enough, so I tried the following:

## this will not run and generate an html report my $html = <html content> my $msg = MIME::Lite->new( Subject => 'my html report', To => 'xxx@gmail.com', Type => 'text/html', Data => $html); $msg->attach( Type => 'text/plain', Path => '/var/tmp/data.txt' Disposition => 'attachment'
I thought that referencing the attachment in an href like the following would do the trick
<a href="./data.txt">
but lo and behold, I have been fooled again! Strangely enough, I did this for image files with <img src> and it worked splendidly, so I'm not sure why it wouldn't work the same for plain text files. Anyone know what I'm doing wrong here?

AS usual, thanks for taking the time to read my lengthy message.

Best Regards, Michael


In reply to displaying an email attachment from a hyperlink by Anonymous Monk

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.