I have aliased a delegated mailbox account (let's call it [email protected]) to my main Google account and written a Script which use GmailApp.createDraft to create an email and store it in the Draft folder, like this:
GmailApp.createDraft('[email protected]', 'mailSubject', '', {
htmlBody: 'html Mail Body',
bcc: mailBccList,
from: '[email protected]',
name: 'Delegate Special Name',
replyTo: '[email protected]'
}
This correctly creates the email... in my main account mailbox Draft folder, which is not what I want.
The objective of this project is to have all email from this delegate account in its own mailbox, the draft ones being the first part of the job.
Of course, it perfectly works if I'm creating emails by hand in the mailbox of this delegated account.
So, did I miss something ? is there a way to create a draft email directly in the mailbox of a delegated account ?
Thx
P.S. don't know if it is important but this delegated is a generic email account (without a real google account).
CodePudding user response:
I believe that you may be getting confused with what a delegated account has access to.
There is a really good explanation in this thread about what you are allowed to do when you have a delegated account. As it's mentioned it could be possible to do what you are looking for if you use the delegated email address using the "Send mail as" feature.
The script you currently have is working as it's generating the draft successfully however it's only affecting your primary account.
CodePudding user response:
The script you currently have is working as it's generating the draft successfully however it's only affecting your primary account.
So, I feel like I should understand that my script cannot access to my delegated account, and thus, cannot create any draft email in it.
I don't really understand why there is such a limitation. This is a generic email account with no other purpose than to be used as a complementary common account by several users. Outlook is doing this easily.
I'm almost quiet new to GW... Do you know if there is a chance that this limited behavior evolves in the good direction ?
Is it something already requested ?
