在某些电子邮件客户端上显示为附件的纯文本电子邮件
Plain text emails displayed as attachment on some email clients
使用某些电子邮件客户端(Evolution、Thunderbird)可以正常查看电子邮件,但使用其他客户端(例如 GMX)时,邮件正文仍为空,并发送包含邮件正文的附件。
我想知道如何防止这种情况发生,因为该邮件旨在供人类阅读并且将正文放在附件中很奇怪。
my $ServerName = "";
my $from_address = '';
my $to_address = '';
my $subject = 'MIME Test: Text';
my $mime_type = 'text';
my $message_body = "This is a test.\n";
# Create the initial text of the message
my $mime_msg = MIME::Lite->new(
From => $from_address,
To => $to_address,
Subject => $subject,
Type => $mime_type,
Data => encode("utf8",$message_body)
) or die "Error creating MIME body: $!\n";
# encode body of message as a string so that we can pass it to Net::SMTP.
$message_body = $mime_msg->body_as_string();
# Let MIME::Lite handle the Net::SMTP details
MIME::Lite->send( 'smtp', $ServerName,);# AuthUser => $user, AuthPass => $pass );
$mime_msg->send() or die "Error sending message: $!\n";
我认为这是你要得到答案的最后一件事
documentation for MIME::Lite
是这样说的
MIME::Lite is not recommended by its current maintainer. There are a number of alternatives, like Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead. MIME::Lite continues to accrue weird bug reports, and it is not receiving a large amount of refactoring due to the availability of better alternatives. Please consider using something else.
"current maintainer" 是独一无二的 Ricardo Signes,我建议您听从他的建议
使用某些电子邮件客户端(Evolution、Thunderbird)可以正常查看电子邮件,但使用其他客户端(例如 GMX)时,邮件正文仍为空,并发送包含邮件正文的附件。
我想知道如何防止这种情况发生,因为该邮件旨在供人类阅读并且将正文放在附件中很奇怪。
my $ServerName = "";
my $from_address = '';
my $to_address = '';
my $subject = 'MIME Test: Text';
my $mime_type = 'text';
my $message_body = "This is a test.\n";
# Create the initial text of the message
my $mime_msg = MIME::Lite->new(
From => $from_address,
To => $to_address,
Subject => $subject,
Type => $mime_type,
Data => encode("utf8",$message_body)
) or die "Error creating MIME body: $!\n";
# encode body of message as a string so that we can pass it to Net::SMTP.
$message_body = $mime_msg->body_as_string();
# Let MIME::Lite handle the Net::SMTP details
MIME::Lite->send( 'smtp', $ServerName,);# AuthUser => $user, AuthPass => $pass );
$mime_msg->send() or die "Error sending message: $!\n";
我认为这是你要得到答案的最后一件事
documentation for MIME::Lite
是这样说的
MIME::Lite is not recommended by its current maintainer. There are a number of alternatives, like Email::MIME or MIME::Entity and Email::Sender, which you should probably use instead. MIME::Lite continues to accrue weird bug reports, and it is not receiving a large amount of refactoring due to the availability of better alternatives. Please consider using something else.
"current maintainer" 是独一无二的 Ricardo Signes,我建议您听从他的建议