I am using this code to send Gmail from a perl script.
use strict;
use warnings;
use Email::Send::SMTP::Gmail;
my ($mail,$error)=Email::Send::SMTP::Gmail->new( -smtp=>'smtp.gmail.com',
-login=>'xxxxxxx@gmail.com',
-pass=>'xxxxxxx');
#print "session error: $error" unless ($email!=-1);
$mail->send(-to=>'zzzzzz@gmail.com', -subject=>"Hello! there $name", -body=>'Just testing it',
-attachments=>'full_path_to_file');
$mail->bye;
This code is inside an for loop and $name is the name of intended person. When I tested it I got some meta-data in my mail
Date: Fri, 12 Dec 2014 12:44:37 +0530
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
This doesn't happen if I use 'Hello'
as -subject
. The $name
variable is causing this . How can I remove the metadata from the mail ?
您可能会遇到HTML Email中的图像阻止 。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.