我以这种方式发送电子邮件:
$message = Yii::$app->mailer->compose()
->setFrom('fromaddress@email.com')
->setTo('toaddress@email.com')
->setSubject('Testing Message-ID')
->setHtmlBody('Test')
->send();
如何从$ message获取消息ID?
答案 0 :(得分:0)
这是解决方案:
$messageId = $message->getSwiftMessage()->getId();