get raw rfc822 message from phpmailer

你。 提交于 2019-12-07 05:00:35

问题


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.


回答1:


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().



来源:https://stackoverflow.com/questions/24957345/get-raw-rfc822-message-from-phpmailer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!