1

I am a bit lost here.

My script intends to send an Email and create calender entries when submitting a form. This works perfectly fine. However, the Email is always sent from my account. But eventually, I want different users in my company to use this script and each submitter needs to be the according sender of the email sent out. Otherwise I will always receive all replies, this won't be fun!!

I am sure this works somehow, but how?

Any ideas or recommendations?

Thanks

user3006481
  • 87
  • 1
  • 2
  • 6

1 Answers1

1

This is normal behavior : when a script sends an email it is sent by the author of the script (in this case : you). That's mainly to respect privacy rules since users filling a form are not asked to grant access to their email , neither to authorize for sending emails in their name.

There are 2 possible solutions :

  1. Use the optional replyTo parameter in the MailApp line (you will always be the sender but when people reply using the 'reply' button the mail will be sent to that address instead of yours.(I assumed you know the submitter's email adress either by asking him in the form or retrieving it automatically if you work in the context of a domain account)
  2. build your form using UiApp or HTMLService as a standalone webapp that will be executed as "the user executing the app" and ask each user for explicit authorization to send email using their account". But that will be a bit more complex to setup compared with normal Google Forms Service.

Knowing that it's up to you to choose the better approach.

Serge insas
  • 45,904
  • 7
  • 105
  • 131
  • Thanks for the fast response, I just wondered, the GAS got the option to "Deploying Your Script as a Web App" - this doesn't appear very complicated at first, is it? – user3006481 Nov 24 '13 at 13:30
  • It all depends what one consider as "complicated" it depends also on how complex is your form... ;-) in this option you'll have to build the entire form in a script. (btw, what about "accepting" the answer above ?) – Serge insas Nov 24 '13 at 13:35
  • Replyto works fine! The only disadvantage I see is that my email will be shown always. This might create confusion when external people receive the email. I might have to create an Alias to get around this challenge. – user3006481 Nov 24 '13 at 13:40
  • What I do personally is creating a group with an address like 'mailing@myDomain.com" as a reply adress, in this group I put whoever wants or needs to be , depending on the circumstances... sometimes I'm in, sometimes not if I'm not interested. This solution works pretty well. – Serge insas Nov 24 '13 at 13:57
  • To add to that, you can use the `name` key in the `options` of the MailApp function that takes the optional parameter. Then it would *look* like it came from a *unique* sender (whoever you want the name to be), and the `replyTo` would still be the desired email address. In total, with those two parameters combined, it looks like it came from a specific person and will reply to that specific person, even though it was sent from your account. – Chris Cirefice Nov 24 '13 at 18:41