Receive raw rfc822 message from phpmailer

I am trying to use google-api-php-client and gmail-api so that my users can authenticate their gmail accounts and send emails through my website. I asked more general questions earlier and decided to ask the PHPMailer community for help with this question.

I used PHPMailer to send emails. And I want to know if I can extract the original rfc822 message from my PHPMailer object after setting it up before sending. Then I would have to make base64_encode on this line and set the "raw" property for my Google_Service_Gmail_Message object.

+4
source share
1 answer

No problem: configure everything as if you were going to send, but instead of a call, send()call preSend(), then select the full message with getSentMIMEMessage().

+6
source