GoogleScript - Change "From" in MailApp

1.3k Views Asked by At

I do not have access to our corporate No-reply Email address to use GmailApp.sendEmail as an alias, so I'm stuck with MailApp.sendEmail

I already have the reply-to corrected; but I am trying to get the actual FROM on the email to show something other than my email address, any suggestions?

   MailApp.sendEmail(emailAddress, "[email protected]", subject, message); 

Thank you in advance.

2

There are 2 best solutions below

1
On BEST ANSWER

Answer:

You can specify the option noReply in order to discourage recipients from responding to emails. However, you have to call the function sendEmail in a different way: sendEmail(recipient, subject, body, options) The parameter options is a Javascript option and looks like this:

options = {
  noReply: true
}

But keep in mind that if you use noReply you can't specify a replyTo address. If you want to provide one for them to reply I would specify it in the message. Futhermore, for future cases I recommend you to use GmailApp instead of MailApp as it has more features.

References:

1
On

Another way is to just create a custom Gmail account for running scripts. You can add a custom name and choose a good avatar