Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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:
I thought that referencing the attachment in an href like the following would do the trick## 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'
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?<a href="./data.txt">
AS usual, thanks for taking the time to read my lengthy message.
Best Regards, Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: displaying an email attachment from a hyperlink
by Anonymous Monk on Dec 26, 2014 at 20:53 UTC |