Skip to content

Sending emails using Google Workspace "service account" with domain-wide delegation. #3015

Answered by td234
td234 asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, solved this. Going to leave this here for anyone else who is looking to make this work.

Using the Gmail API directly with PHPMailer is not the typical approach because PHPMailer is primarily designed for SMTP communication, while the Gmail API uses HTTP requests to interact with Gmail. However, you can still leverage PHPMailer's capabilities for building MIME email messages, which can be useful if you're comfortable with PHPMailer's API for composing emails but want to send them through the Gmail API.

Here's the approach on how you might combine PHPMailer for creating the email message and the Gmail API for sending the message:

Compose the email with PHPMailer: Use PHPMailer to crea…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@td234
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by td234
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants