1
使用某些電子郵件客戶端(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";
我使用電子郵件發件人::現在一切工作正常。 –