Reg: html Form retrieved data from that to sheets issue

39 views
Skip to first unread message

2morow never comes

unread,
Apr 28, 2020, 1:48:31 AM4/28/20
to Google Apps Script Community
Hi ,
I have isssues in sending mail from the retrieved data from html form to a certain mails..
I had created a form and on submitting it will retrieve data to sheets and populate the form format in the sheets using replace..{} after that it sends mail to sumbitted and one another person..
So totally 2 ..
What I have issue is.. it is working correct in my Google sheets file.
But when I transfer the code to another client changing all the open by I'd..
It works till generating pdf..
But when it comes to mail.. it is not sent.
What is the issue.. I have added for check to get values to sheet instead of logger log.. so i get the set value in the sheets just before sending mail.. but it fails once after that..
Since after I copy to the shared sheet and also ther person who is the owner is a gsuite school teacher.. it is getting difficult for asking to republish to check everytime..
Why is this behaviour.. it worked correctly in my sheet, but transferred is getting failed at mail.. he has quota of 1400 mail.. so that also not issue..
Can anybody help where it is going wrong?

When I transfer the

2morow never comes

unread,
Apr 28, 2020, 2:52:53 AM4/28/20
to google-apps-sc...@googlegroups.com
Hi Alan/ Andrew or anyone,
Can you help me with this? 
I am not able to understand the issue..
Form issue or mai quota or queuing or timeout..
Form is a html webapp..
Owner is client ..
So everytime he needs to republish, for my checking..
The same code works when I make a copy and I become owner. It is sending mail..
But the problem when in the original file it is not sending mail..
The client has sufficient quota and I am using Gmail app.. and not mailapp.. two mails are sent of the form data, one mail is owner of the sheet's mail and other user entered mail..
It is quite urgent...

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/8fe5cf24-0a28-40a4-9a6c-89b711dbc9a7%40googlegroups.com.

Alan Wells

unread,
Apr 28, 2020, 9:04:28 AM4/28/20
to Google Apps Script Community
I don't know what the problem is.  There are probably, literally hundreds of things that could be wrong.  It's impossible for me or anyone to know what the exact problem is.  If the code is running for the person who made the copy, then their account obviously has permission to run the code.  The only way that you can have some permissions and not others is if you are setting scopes in the manifest file.  Did you set the scopes in the manifest file, and fail to include the GMail scope?
If that's not the problem, then it's a bug.  And I can't debug your code.  You need to find out what line is failing and what the error message is.

2morow never comes

unread,
Apr 28, 2020, 9:17:56 AM4/28/20
to google-apps-sc...@googlegroups.com
Hi alan,
I am facing issues at gmailapp send line..
I don't understand the issue..
As it works when I am the owner of the sheet..
The form provides the data back to sheet.. pdf file is created.. then  mail alone not sent..
The above behavior happens when I copy the code to the other person and ask him to publish the url of the form.. and with that url when I try sending the form details to sheet.. it does till pdf creation..
But no mail sent..
I couldn't transfer file ownership as mine is gmail domain and his organisation..


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

Alan Wells

unread,
Apr 28, 2020, 9:21:49 AM4/28/20
to Google Apps Script Community
Who owns the Google Form?  Where is the code running from, the Sheet, the Form?  Does the user also copy the Google Form?  Do YOU own the Google Form?  Is there a different Google From for every Sheet?  Or is it the same Form?
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

2morow never comes

unread,
Apr 28, 2020, 9:33:31 AM4/28/20
to google-apps-sc...@googlegroups.com
Html form - one form.
It has 5 input button one send button.
After send.. formobjects are brought to sheet and saved in response sheet.
Then I have the same format of the form ,as I want to send submitted copy to those submit form..
In that I take from the response sheet, and use {} to replace the data with new one from response sheet..
This is done by copying the format sheet ,then filling the details from response sheet ,creation of pdf and send mail..
I completed the form in my sheets file and published and test run the form. It worked fine.

Then I copied the code and sheet - format tab to the client file,where he is the owner and I am shared with.

Then he published the form and gave the url for testing.. when I checked it goes through till pdf creation..
I had provided as a check before mail line to setvalue of the mail about to send to sheet..
So it is placing that value in the sheet.
But mail is not sent.
I see he has sufficient quota.

As a check.. I created in the same file to take values and sendmail..
It is running fully..
So file has no issues of I'd or any other stuff..

This is where I stand now..

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/peCFiWNyKRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/bf4e5cbc-6383-4bf3-830d-6efe7d95e034%40googlegroups.com.

Alan Wells

unread,
Apr 28, 2020, 9:55:26 AM4/28/20
to Google Apps Script Community
 If the code is failing then there should be an error message.  You can check StackDriver for an error message.  You can wrap the Gmail send line with a try/catch

try{
 
GMailApp.sendEmail();

}catch(e){
  my_Error_Handling_Fnc
(e);

}

If there is no error, then GMail didn't have a valid email address.

2morow never comes

unread,
Apr 28, 2020, 10:19:20 AM4/28/20
to google-apps-sc...@googlegroups.com
Hi alan,
Suspecting issue.. I created a separate function in that file to check whether he could send mails and asked the user to click the button running that function..
Now he has confirmed exception error: gmail operation not allowed.. mail service not enabled..
How should i go about from here..


--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/peCFiWNyKRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.

Alan Wells

unread,
Apr 28, 2020, 10:29:37 AM4/28/20
to Google Apps Script Community
In a GSuite account, the Gmail service needs to be enabled for that user.  The Admin of the GSuite account needs to enable that setting.  Do an internet search and see what you can find.


On Tuesday, April 28, 2020 at 10:19:20 AM UTC-4, 2morow never comes wrote:
Hi alan,
Suspecting issue.. I created a separate function in that file to check whether he could send mails and asked the user to click the button running that function..
Now he has confirmed exception error: gmail operation not allowed.. mail service not enabled..
How should i go about from here..


On Tue, Apr 28, 2020, 7:25 PM Alan Wells <aj.a...@gmail.com> wrote:
 If the code is failing then there should be an error message.  You can check StackDriver for an error message.  You can wrap the Gmail send line with a try/catch

try{
 
GMailApp.sendEmail();

}catch(e){
  my_Error_Handling_Fnc
(e);

}

If there is no error, then GMail didn't have a valid email address.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/peCFiWNyKRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-community+unsub...@googlegroups.com.

2morow never comes

unread,
Apr 28, 2020, 10:39:19 AM4/28/20
to google-apps-sc...@googlegroups.com
Hi, 
But one doubt..
I did two forms and transferred to him..
That was running fine.. why is this ..
Having issues like this?
That also should have the same issues right?

On Tue, Apr 28, 2020, 7:59 PM Alan Wells <aj.a...@gmail.com> wrote:
In a GSuite account, the Gmail service needs to be enabled for that user.  The Admin of the GSuite account needs to enable that setting.  Do an internet search and see what you can find.

On Tuesday, April 28, 2020 at 10:19:20 AM UTC-4, 2morow never comes wrote:
Hi alan,
Suspecting issue.. I created a separate function in that file to check whether he could send mails and asked the user to click the button running that function..
Now he has confirmed exception error: gmail operation not allowed.. mail service not enabled..
How should i go about from here..


On Tue, Apr 28, 2020, 7:25 PM Alan Wells <aj.a...@gmail.com> wrote:
 If the code is failing then there should be an error message.  You can check StackDriver for an error message.  You can wrap the Gmail send line with a try/catch

try{
 
GMailApp.sendEmail();

}catch(e){
  my_Error_Handling_Fnc
(e);

}

If there is no error, then GMail didn't have a valid email address.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/peCFiWNyKRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/66085c6a-8797-4d14-96f5-bd471cd40a18%40googlegroups.com.

Alan Wells

unread,
Apr 28, 2020, 12:10:50 PM4/28/20
to Google Apps Script Community
I don't know the answer to that.  It seems that the:
mail service not enabled
error probably isn't a code error.
I have seen error messages that were not accurate, but if your test code was just a simple, one line of code
then the error is probably correct.
I don't know why some code would work and other code in the same account wouldn't, if that's the situation.

On Tuesday, April 28, 2020 at 10:39:19 AM UTC-4, 2morow never comes wrote:
Hi, 
But one doubt..
I did two forms and transferred to him..
That was running fine.. why is this ..
Having issues like this?
That also should have the same issues right?

On Tue, Apr 28, 2020, 7:59 PM Alan Wells <aj.a...@gmail.com> wrote:
In a GSuite account, the Gmail service needs to be enabled for that user.  The Admin of the GSuite account needs to enable that setting.  Do an internet search and see what you can find.

On Tuesday, April 28, 2020 at 10:19:20 AM UTC-4, 2morow never comes wrote:
Hi alan,
Suspecting issue.. I created a separate function in that file to check whether he could send mails and asked the user to click the button running that function..
Now he has confirmed exception error: gmail operation not allowed.. mail service not enabled..
How should i go about from here..


On Tue, Apr 28, 2020, 7:25 PM Alan Wells <aj.a...@gmail.com> wrote:
 If the code is failing then there should be an error message.  You can check StackDriver for an error message.  You can wrap the Gmail send line with a try/catch

try{
 
GMailApp.sendEmail();

}catch(e){
  my_Error_Handling_Fnc
(e);

}

If there is no error, then GMail didn't have a valid email address.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/peCFiWNyKRo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages