Question

How to change the email that sends the email of my google form script.

the form is accessible to 4 google accounts. I wrote it on mine. I want it to send from a different account, the one that is nobodies personal email.

Any idea?

for the record, this is, for the most part, the script

function generatePost(e){

  var html = "hello"; 
    // sends from my personal email
    MailApp.sendEmail(e.values[7], ' ok!,  ' + e.values[2], html,{htmlBody: html}); 

  }

https://developers.google.com/apps-script/reference/mail/mail-app

Was it helpful?

Solution

It looks like you need to change the default replyTo address.

Look at the documentation on the function you're using: sendEmail(to, replyTo, subject, body)

The default of replyTo is "the user's email address". Just change it to a string of the email you want to use, i.e.:

sendEmail(e.values[7], "your_email@gmail.com", ' ok!, ' + e.values[2], html,{htmlBody: html})

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top