MailApp does not seem to send any emails

271 views
Skip to first unread message

Iryna Tarasenko

unread,
Dec 23, 2022, 5:28:33 AM12/23/22
to Google Ads Scripts Forum
Hey,

For some reason the MailApp.send_email does not work for me. 

E.g. I do the following:

var emailQuotaRemaining = MailApp.getRemainingDailyQuota();
  Logger.log("Remaining email quota: " + emailQuotaRemaining);
 
  MailApp.sendEmail(
    {
      to: RECIPIENT_EMAILS.join(','),
      subject: "Test",
      body: "Test 123"
    });

Where the email is a valid email, and the quota shows appox 1400 left emails.

I was trying to use also the sendEmail with 3 parameters, (e.g. to, subject, body) but it does not work.

Its quite unfortunate that these function does not have return codes, so its not clear what exactly is wrong.

Could you please check from your side the function?

Iryna

Google Ads Scripts Forum Advisor

unread,
Dec 27, 2022, 2:29:11 AM12/27/22
to adwords...@googlegroups.com

Hello Iryna,

I’m James from the Google Ads Scripts Team. Thank you for raising your concern to us.

For us to check your issue, could you please provide us with the following details below.

  • Google Ads account ID / CID
  • Script name
  • User email used to authorized your script

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2hNB46:ref

Iryna Tarasenko

unread,
Dec 27, 2022, 3:52:07 AM12/27/22
to Google Ads Scripts Forum
hi James!
Thank you for reply to me.
Here are details you requested:  
SCA Libero | Sverige 627-890-6676
Libero_SE_Link_Checker

Waiting for response, 
Iryna

Google Ads Scripts Forum Advisor

unread,
Dec 28, 2022, 5:58:59 AM12/28/22
to adwords...@googlegroups.com

Hi Iryna,

 

This is Yasmin from the Google Ads Scripts Team.

 

It appears that you are trying to add another instance of the MailApp in the Link Checker solution script. Could you please elaborate what you are aiming for or trying to achieve? I believe the Link Checker solution script does send out an email after it's analysis.

 

Best regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2hNB46:ref

Ntv Niws24

unread,
Dec 28, 2022, 6:35:57 AM12/28/22
to Google Ads Scripts Forum on behalf of adsscripts
My Google ads account nat ran hoiy please help 

বুধ, 28 ডিসে., 2022 4:58 PM তারিখে Google Ads Scripts Forum on behalf of adsscripts <adwords...@googlegroups.com> লিখেছেন:
--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/6X54Y000000000000000000000000000000000000000000000RNLL6100IOeKiOmhQ7OIYY9H7DmVUQ%40sfdc.net.

Iryna Tarasenko

unread,
Dec 28, 2022, 7:47:07 AM12/28/22
to Google Ads Scripts Forum
Hey,

I was trying to understand why the LinkChecker does not send emails after the runs. So I was trying to debug why nothing is sent.

I dont think I am adding any other instance of the MailApp, but rather using the existing one. Which lines of the code are you referring?

Iryna

Google Ads Scripts Forum Advisor

unread,
Dec 29, 2022, 1:29:47 AM12/29/22
to adwords...@googlegroups.com

Hi Iryna,

 

Thank you for the clarification.

 

I was pertaining to the test email you had set up. That said, kindly note that the link checker script sends out an email based on the Configuration that was set in the spreadsheet. The script would call those functions to send out an email once the conditions have been met.

 

If you are encountering a discrepancy, such that if you have enabled those conditions, and are still not receiving an email, kindly provide a shareable link of the spreadsheet the script is using (You may follow this guide under Share a file publicly) so we're able to further investigate.

Iryna Tarasenko

unread,
Dec 30, 2022, 3:47:36 AM12/30/22
to Google Ads Scripts Forum
hi!

Thank you for you reply.
I can share the document to specific email because Results tab contains sensitive information that shouldn't be shared publicly.
I'm attaching a screenshot from the document where you can check the configuration (please review the attached file)

I believe that the problem is not with the configuration! I have found functions responsible for sending emails in the script, and added logging there.
As far as I see, the functions are called. And the part that does not work is this:  MailApp.sendEmail function.

For example the following code is executed in the link checker:

var emailQuotaRemaining = MailApp.getRemainingDailyQuota();
  Logger.log("Remaining email quota: " + emailQuotaRemaining);
 
So I can see the log output: "Remaining email quota: 1402"

But these lines (in the same functinon, that are just following lines above are producing nothing)

  MailApp.sendEmail(
    {
      to: RECIPIENT_EMAILS.join(','),
      subject: "Test",
      body: "Test 123"
    });

Looking forward on the investigation from you why the function doesn't send the email.

Thank you,
Iryna

2022-12-30_09-37-57.png

Google Ads Scripts Forum Advisor

unread,
Jan 4, 2023, 2:45:55 AM1/4/23
to adwords...@googlegroups.com

Hi Iryna,

 

Thank you for getting back. I do appreciate you providing more context to this.

 

That being said, I had done further testing for this (replicating the configuration you had set) and was able to receive an email being sent by the function sendFinalEmail. I had included a log statement to make sure the function was being called as well. For more context, I had structured the MailApp the same way it does for sending out the Link Checker analysis email. You can refer to the snippet of code below:

MailApp.sendEmail(RECIPIENT_EMAILS.join(','), 'test', `test`);

 

I was able to receive two emails, one with the Link Checker results and another for this test email. Kindly try this on your end and let me know how it goes. If you would encounter a discrepancy, kindly provide screenshots showing the issue via `Reply privately to author` option. If the said option is not available on your end, you may send those through the email alias `googleadsscr...@google.com` instead.

Reply all
Reply to author
Forward
0 new messages