从Gmail发送的元数据通过电子邮件发送

时间:2014-12-12 07:21:17

标签: 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',
                                                 -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变量导致此问题。如何从邮件中删除元数据?

1 个答案:

答案 0 :(得分:0)

您可能面临Image Blocking in HTML Email

相关问题