5

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.

Community
  • 1
  • 1
Gavin Palmer
  • 1,220
  • 15
  • 25

1 Answers1

12

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

Synchro
  • 35,538
  • 15
  • 81
  • 104