php - 如何从 PHPMailer 获取邮件正文?

标签 php smtp phpmailer

我使用 PHPMailer 通过 SMTP 发送电子邮件。它有效,但它不会将发送的电子邮件保存在

已发送的项目。我想在 sent items 中添加已发送的电子邮件,知道吗?

我知道可以用imap_append函数来实现。但是,该怎么做呢?

PHPMailer 似乎没有返回$message 的功能。

if ($return = $mail->Send()) {

$stream = imap_open("{{$host}:993/imap/ssl}Sent Items", $user_name, $user_pwd); 

imap_append($stream, "{{$host}:993/imap/ssl}Sent Items" , $message  , "\\Seen");

imap_close($stream);

};

如何从PHPMailer获取邮件正文?

最佳答案

PHPMailer 中的实例变量都是公开的。 查看您可以使用的源代码:

$mail->Body

如果您想要包含所有边界的普通主体,您还可以使用:

$mail->CreateBody();

参见: http://phpmailer.svn.sourceforge.net/viewvc/phpmailer/trunk/phpmailer/class.phpmailer.php?revision=452&view=markup

关于php - 如何从 PHPMailer 获取邮件正文?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7158228/

相关文章:

python - 为每个收件人发送一封邮件

php - WP Mail SMTP 版本 1.4.2 停止发送电子邮件

PHP 邮件程序 "Warning: stream_socket_enable_crypto():"错误

php - 尝试在 Amazon AWS 上的 mySQL 数据库上使用 JSON_OBJECT 函数

php - 将图像从swift上传到php服务器时出错

python - 使用 python SMTP 发送电子邮件时遇到问题

java - SMTP 主机配置

C# 之于 Visual Studio 就像 PHP 之于……什么?

php - 单选按钮的值无法存储到 String 中并保存在 mysql 中

php - 作为垃圾邮件发送的帐户确认电子邮件