CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Sending an email with attachment (remote file)

 



superman
New User

Jan 20, 2015, 3:31 PM

Post #1 of 2 (1515 views)
Sending an email with attachment (remote file) Can't Post

Hi,

I'm currently using MIME Lite to send email from a linux server. I have an attachment that is located in another server and I can access it using a url, for example http://test.com/test.jpg. If I have a perl script that sends out email from another server using MIME Lite, can I somehow add the http://test.com/test.jpg image as an attachment using the url?

I've tried this:

attach $msg (
Type => 'application/octet-stream',
Encoding => 'base64',
Path => "http://test.com/test.jpg",
Filename => "test.jpg"
);

but it doesn't work. Does anyone know a work around for this?

Thanks,

Tom


FishMonger
Veteran / Moderator

Jan 20, 2015, 4:12 PM

Post #2 of 2 (1513 views)
Re: [superman] Sending an email with attachment (remote file) [In reply to] Can't Post

Use the LWP::Simple module to download the file onto your computer and then attach it to the email.

http://search.cpan.org/~mschilli/libwww-perl-6.08/lib/LWP/Simple.pm

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives