从phpmailer获得原始的rfc822消息 [英] get raw rfc822 message from phpmailer

查看:87
本文介绍了从phpmailer获得原始的rfc822消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用google-api-php-client和gmail-api来允许我的用户通过我的网站验证他们的Gmail帐户并发送电子邮件。我早些时候提出了一个更普遍的问题,决定从这个问题寻求PHPMailer社区的帮助。

我使用PHPMailer发送电子邮件。我想知道是否可以在发送之前从我的PHPMailer对象中提取原始rfc822消息。然后,我应该能够对该字符串执行base64_encode并为我的Google_Service_Gmail_Message设置raw属性。

解决方案

没问题:设置所有内容,就好像你要发送一样,而不是调用 send (),调用 preSend(),然后使用 getSentMIMEMessage()


I am trying to use google-api-php-client and gmail-api to allow my users to authenticate their gmail accounts and send emails through my website. I asked a more generic questions earlier and decided to seek help from the PHPMailer community with this question.

I have used PHPMailer to send emails. And I want to know if I can extract the raw rfc822 message from my PHPMailer object after setting it up prior to sending. I should be able to then do a base64_encode on that string and set the "raw" property for my Google_Service_Gmail_Message.

解决方案

No problem: Set up everything as if you were going to send, but instead of calling send(), call preSend(), then fetch the complete message using getSentMIMEMessage().

这篇关于从phpmailer获得原始的rfc822消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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