是否可以使用 Mail::Sender 发送只有 cc 或 bcc 收件人的电子邮件?当我尝试发送没有“收件人”地址的电子邮件时,我得到了预期的返回码:
-8 = argument $to empty
最佳答案
在“收件人”字段中使用空字符串 ''
无效。使用空间就像一种魅力。
use Mail::Sender;
my $sender = Mail::Sender->new();
my $mail = {
smtp => 'mailserver',
from => 'example@example.com',
to => ' ',
bcc => 'example@example.com',
subject => 'test',
ctype => 'text/plain; charset=utf-8',
skip_bad_recipients => 1,
msg => 'test'
};
my $ret = $sender->MailMsg($mail);
print $ret;
关于perl - 如何使用 Mail::Sender 发送没有 "to"地址的电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/452404/