Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get raw rfc822 message from phpmailer

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.

like image 741
Gavin Palmer Avatar asked Jul 25 '14 13:07

Gavin Palmer


1 Answers

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

like image 78
Synchro Avatar answered Nov 15 '22 07:11

Synchro