Perl 从通过电子邮件发送的Gmail中删除元数据
我使用这段代码从perl脚本发送GmailPerl 从通过电子邮件发送的Gmail中删除元数据,perl,gmail,Perl,Gmail,我使用这段代码从perl脚本发送Gmail 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',
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;
此代码位于for循环中,$name是预期人员的姓名。
当我测试它时,我在邮件中得到了一些元数据
Date: Fri, 12 Dec 2014 12:44:37 +0530
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
如果我将
'Hello'
用作-subject
,则不会发生这种情况。$name
变量导致此问题。如何从邮件中删除元数据?您可能会遇到。是否可以在$name末尾添加新行?