使用phpmailer发送的邮件不要转到“已发送"邮件中. IMAP资料夹 [英] Sent mails with phpmailer don't go to "Sent" IMAP folder
本文介绍了使用phpmailer发送的邮件不要转到“已发送"邮件中. IMAP资料夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的CRM在线系统中,我使用IMAP协议控制传入的邮件. 现在,我正在使用phpmailer和SMTP协议发送邮件. 一切都很好,但我有一件奇怪的事情.如何使用phpmailer脚本发送的邮件转到已发送" IMAP文件夹?
in my CRM online system I control ingoing mails with IMAP protocol. Now I'm making sending mails with phpmailer and SMTP protocol. Everything is ok but I have one wierd thing. How to make sent with phpmailer script mails go to "Sent" IMAP folder?
推荐答案
PHPMailer中现在有一个方法getSentMIMEMessage返回整个MIME字符串
There is now a method getSentMIMEMessage in PHPMailer which returns the whole MIME string
$mail = new PHPMailer();
//code to handle phpmailer
$result = $mail->Send();
if ($result) {
$mail_string = $mail->getSentMIMEMessage();
imap_append($ImapStream, $folder, $mail_string, "\\Seen");
}
这篇关于使用phpmailer发送的邮件不要转到“已发送"邮件中. IMAP资料夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文