Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forward mail using gmail API

Is there any code provided by google to forward mail. because i haven't found one. If there is any way to forward mail using GMAIL API with extra content to send with original message. Please help.

like image 854
Rider Avatar asked Jun 23 '15 06:06

Rider


People also ask

Can you automatically forward emails in Gmail?

You can automatically forward your messages to another address. You can choose to forward all new messages, or just certain ones. Note: You can only set up forwarding on your computer, and not on the Gmail app. If you have an account through work or school and have trouble, contact your administrator.

Does Gmail have free forwarding?

Email forwarding lets you create an extra email address (“email alias”) to receive emails. You can create up to 100 email aliases for your domain at no cost. Example: Miriam's email address is [email protected].


2 Answers

I don't see any specific forward operation...

You'll have to:

  1. get the message,
  2. add your extra content to the top of the original message and
  3. change the to address, then
  4. send it.

Not much help to you but take note of the Threads.

like image 79
John Mee Avatar answered Oct 19 '22 16:10

John Mee


Watch out while doing this procedure !

I used the answer of Jhon Mee to forward all emails from a user to an other one. If you just change the "To:" it will continue to send the emails to everyone in "Cc:" and "Bcc:"

Here is the procedure:

  1. Retreive the email in raw format
  2. Decode the email from base64
  3. Replace the line "To:" with the email you want to forward to
  4. Remove the lines "CC:" and "Bcc:"
  5. Send it
like image 22
Martin Paucot Avatar answered Oct 19 '22 16:10

Martin Paucot