使用 phpmailer 发送的邮件不会转到“已发送";IMAP 文件夹 [英] Sent mails with phpmailer don't go to "Sent" IMAP folder

查看:25
本文介绍了使用 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆