MailApp is not working for my script; I am not receiving emails

1,035 views
Skip to first unread message

Aldric Kurt Ang

unread,
Aug 11, 2023, 11:06:44 AM8/11/23
to Google Apps Script Community

I tried running this snippet of code (see below) in a script to test out if I'd receive an email but don't receive one. The email I use as recipient is aldri...@emma-sleep.com. I'm assuming the problem is that the MailApp service is not able to send emails to my address for whatever reason. Maybe it's because my email address is structured differently? Has anyone had a similar problem with their business email address, or know the solution to this? Any help is much appreciated thanks!

function main() { 
   MailApp.sendEmail("aldri...@emma-sleep.com",
   "TPS report status",
   "What is the status of those TPS reports?");
 }

Edward Wu

unread,
Aug 11, 2023, 2:04:56 PM8/11/23
to google-apps-sc...@googlegroups.com
That code works fine for me. I don't think the script is the problem.

Is emma-sleep.com's email hosted by Google/Gmail? I've noticed sometimes that when I use a script to send an email to myself, it won't show up in my Inbox. But I can find it in All Mail and/or Sent.


--
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/66c77027-b7fa-44e7-ac4f-cae26a73746fn%40googlegroups.com.

Peter Berkhout

unread,
Aug 11, 2023, 3:58:25 PM8/11/23
to Google Apps Script Community
I had a similar problem. Maybe this wil help you further. It helped me.
And using GMailApp.sendEmail instead of MailApp.sendEmail helped me too.

Op vrijdag 11 augustus 2023 om 17:06:44 UTC+2 schreef aldri...@emma-sleep.com:

Aldric Kurt Ang

unread,
Aug 12, 2023, 8:13:14 AM8/12/23
to Google Apps Script Community
Hey Edward and Peter, thanks for the responses! I believe you're right that the problem is my email address. My address @emma-sleep.com is not hosted by Google/Gmail, but rather in Outlook. Is there a way to send emails to email addresses in Outlook? Thanks again for your help!
Message has been deleted

Peter Berkhout

unread,
Aug 13, 2023, 5:03:50 AM8/13/23
to Google Apps Script Community
Have you tried this?
https://support.google.com/mail/answer/22370?hl=en#zippy=%2Cchange-default-reply-to-address

Op zaterdag 12 augustus 2023 om 14:13:14 UTC+2 schreef aldri...@emma-sleep.com:
Reply all
Reply to author
Forward
0 new messages