About Google Apps Script Google Forms

Asked 2 years ago, Updated 2 years ago, 22 views

He has no programming knowledge.
I know this is a poor question, but I would appreciate your help.

What I'm trying to create now is
"Use the Google form as the contact form and forward the call to a specific email address.
If you reply to the forwarded email, you will receive an email (you can reply to the inquiry) via Google form.
That's how it works.

I created a Google form and put the following split in the split editor.

function submitForm(e){ 
  varitemResponses=e.response.getItemResponses(); 
  var message=';
  var report = itemResponses[0].getResponse();

  for (vari=0;i<itemResponses.length;i++) { 
    variableResponse=itemResponses[i]; 
    varquestion=itemResponse.getItem().getTitle(); 
    var answer = itemResponse.getResponse(); 

    if(question=='Google form item name(name)'){
      var username = answer;
    }
    if(question=='Google form item name (email address)'){
      var usermail=answer;
    }

    message+=(i+1).toString()+'.'+question+':'+answer+'\n'; 
  } 


  /* Administrator Mailing Settings*/
  var address='★My email address★'; 
  var title='[Your inquiry has been received]'; 
  var content='Your response has been received with the following:\n\n'
  + message
  + US>'\n\n'
  + *This is an automated email sent from Google form.'; 
  var options={from:address,name:'●●'};

  GmailApp.sendEmail(address, title, content, options);


  /* User Mailing Settings*/
  var title2 = '[Your inquiry has been received]'; 
  var content2 = username 
  + US>'Dear\n\n'
  + We have received your inquiry with the following information.\n\n'
  + message 
  + '\n\n*This is an automated email from Google form.'; 

  GmailApp.sendEmail(usermail, title2, content2, options); 


}

Then you can send your email address
If you set it up with gmail, it will be transferred properly, but
If configured outside of gmail, it will not be transferred.
Is it impossible to use Google form unless the forwarding address is gmail?
Or is it possible to solve this problem by editing the split?

Thank you for your cooperation.

javascript

2022-09-30 10:29

1 Answers

It seems that only Gmail addresses that can be sent by Gmail can be sent from Google Apps Script. (Because I use Gmail)

If you want to set another address that you own to From, it seems to be available if you set that address as a Gmail alias address.

[Google Apps Script] Send mail from a different address. | Beginner Memorandum


2022-09-30 10:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.