抄送,密件抄送无法在 Perl 上使用 Net::SMTP,具有多个电子邮件 ID
cc, bcc not working with Net::SMTP on perl, with multiple email ids
我正在努力通过 perl 脚本向抄送列表中的人发送邮件。实际收件人正在接收包含正确内容的电子邮件。但是ccList中的邮箱收不到邮件。
$smtp->data();
$smtp->datasend("From: $supportEmail\r\n");
$smtp->datasend("To: $toAddress\r\n");
$smtp->datasend("Cc: $ccList\r\n");
$smtp->datasend("Subject: " .$subject. "\r\n");
$smtp->datasend("\r\n");
#Send the message.
$smtp->datasend("$message");
$smtp->datasend("\r\n");
$smtp->dataend();
There are more than one valid email address in $ccList
$ccList = 'xyz@gmail.com,pqr@gmail.com';
Bad recipient address syntax
is what I get in logs.
您需要先将所有收件人通知服务器。代码应如下所示:
$smtp->mail($supportEmail);
$smtp->to($toAddress);
$smtp->cc($ccList);
$smtp->data();
$smtp->datasend("From: $supportEmail\r\n");
$smtp->datasend("To: $toAddress\r\n");
$smtp->datasend("Cc: $ccList\r\n");
$smtp->datasend("Subject: " .$subject. "\r\n");
$smtp->datasend("\r\n");
#Send the message.
$smtp->datasend("$message");
$smtp->datasend("\r\n");
$smtp->dataend();
我正在努力通过 perl 脚本向抄送列表中的人发送邮件。实际收件人正在接收包含正确内容的电子邮件。但是ccList中的邮箱收不到邮件。
$smtp->data();
$smtp->datasend("From: $supportEmail\r\n");
$smtp->datasend("To: $toAddress\r\n");
$smtp->datasend("Cc: $ccList\r\n");
$smtp->datasend("Subject: " .$subject. "\r\n");
$smtp->datasend("\r\n");
#Send the message.
$smtp->datasend("$message");
$smtp->datasend("\r\n");
$smtp->dataend();
There are more than one valid email address in
$ccList
$ccList = 'xyz@gmail.com,pqr@gmail.com';
Bad recipient address syntax is what I get in logs.
您需要先将所有收件人通知服务器。代码应如下所示:
$smtp->mail($supportEmail);
$smtp->to($toAddress);
$smtp->cc($ccList);
$smtp->data();
$smtp->datasend("From: $supportEmail\r\n");
$smtp->datasend("To: $toAddress\r\n");
$smtp->datasend("Cc: $ccList\r\n");
$smtp->datasend("Subject: " .$subject. "\r\n");
$smtp->datasend("\r\n");
#Send the message.
$smtp->datasend("$message");
$smtp->datasend("\r\n");
$smtp->dataend();