从phpmailer获得原始的rfc822消息 [英] get raw rfc822 message from phpmailer
问题描述
我正尝试使用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屋!