Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: sending emails with attachements via gmail

by clueless newbie (Curate)
on Mar 13, 2020 at 11:47 UTC ( [id://11114215] : note . print w/replies, xml ) Need Help??


in reply to sending emails with attachements via gmail

From the synopisis of Email::Send::SMTP::Gmail:

use strict; use warnings; use Email::Send::SMTP::Gmail; my ($mail,$error)=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.co +m', -login=>'whateveraddr +ess@gmail.com', -pass=>'whatever_pass +'); print "session error: $error" unless ($email!=-1); $mail->send(-to=>'target@xxx.com', -subject=>'Hello!', -body=>'Just te +sting it', -attachments=>'full_path_to_file'); $mail->bye;