Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MailApp.sendEmail Not Working?

I have several scripts in Google Docs spreadsheets that use MailApp.sendEmail to send e-mails incorporating data from the spreadsheets. They've all worked marvelously for years. About 2 weeks ago, they stopped sending the e-mails. The scripts still run and I don't get any errors. The e-mails just never come through. Nothing has changed, except that the e-mails aren't arriving anymore.

Any thoughts?

Thanks!

like image 256
doebtown Avatar asked Jun 28 '13 01:06

doebtown


People also ask

What is MailApp Sendemail?

MailApp. Sends email. This service allows users to send emails with complete control over the content of the email. Unlike GmailApp, MailApp's sole purpose is sending email.


1 Answers

I think I have an answer to my own question, which may be helpful to anybody else who has this problem. MailApp.sendEmail DOES, indeed, still seem to be working. What has changed is the way Gmail is handling certain types of messages.

If I use MailApp.sendEmail to send an e-mail to a third party, it'll get through, no problem. As pointed out by Fashtas, if I use MailApp.sendEmail to send an e-mail to the Gmail account that the spreadsheet belongs to, no problem.

Here's the problem: if I use MailApp.sendEmail to send the message to a third party account that automatically forwards BACK to the Gmail account that the spreadsheet belongs to, those messages no longer get through.

Therefore, in the sample code I posted above, the matt@.com e-mail address automatically forwards back to my Gmail account. The messages sent by the MailApp.sendEmail make it through to the .com mail server, but for some reason, they don't get forwarded back to my Gmail inbox. They appear in the Gmail Sent Items folder (presumably because they were sent by the Gmail account that the spreadsheet belongs to), but they never hit the inbox.

That behavior is new. In the past, there has been no problem with those messages getting forwarded from the *.com server to my Gmail inbox. I don't know what changed to cause the problem. And I don't know how to fix it.

But I, therefore, think the answer to my question is that MailApp.sendEmail IS working as designed.

like image 106
doebtown Avatar answered Oct 01 '22 22:10

doebtown