dwyl / learn-to-send-email-via-google-script-html-no-server

:email: An Example of using an HTML form (e.g: "Contact Us" on a website) to send Email without a Backend Server (using a Google Script) perfect for static websites that need to collect data.
GNU General Public License v2.0
3.15k stars 910 forks source link

Google Mailer Daemon blocks MailApp.sendEmail #226

Closed HEARclassical closed 6 years ago

HEARclassical commented 6 years ago

I've followed your tutorial and got the spreadsheet populating on form submission (thank you!) but every email i send to myself is being blocked by gmail.

I've found some evidence of not being alone in this elsewhere on the web (e.g. https://groups.google.com/forum/#!topic/adwords-scripts/eqbOnpAupZY from a few months ago).

The spreadsheet I am using was created by the same account that the google script is sending messages to.

Any insight into this would be much appreciated.

mckennapsean commented 6 years ago

Not sure why it gets marked as spam, sorry. That is baffling, you think it wouldn't... but sometimes services are weird.

Here is what we use, I think: https://developers.google.com/apps-script/reference/mail/

It also seems that there is a GmailService. Maybe we should switch to that. That could be better and avoid getting marked as spam. Other methods would be to tell Gmail those are NOT spam, and it may learn from that marking. Or change the content/subject of what is sent to make it not be filtered as spam.

In other news, I found another place that posts the email limits. And you can query how many you have left which is neat. https://script.google.com/dashboard

mckennapsean commented 6 years ago

Any luck figuring out the issue @HEARclassical ? This seems like something we have no control over, unless a different API would fix the issue. Sounds like a bug to file with Google on their issue tracker.

mckennapsean commented 6 years ago

If anyone has consistent trouble with this, I would report to Google, it has been working fine for me, but this seems beyond our control.

If it keeps happening to someone, please consider looking into an external API to send emails instead.

HEARclassical commented 6 years ago

Sorry for late reply. The problem was that the titles my google form and corresponding app script were not identical. i find it surprising that this is necessary, but it did solve the problem!

mckennapsean commented 6 years ago

odd, glad to hear you found the solution to your problem though!!

trozman commented 5 years ago

I had a similar issue since apr 2019. The problem was the following: There was a link in the email body: http://.. When I replaced URL of the link (http:) with secure https://...... the problem was solved and emails weren't blocked anymore.

mckennapsean commented 5 years ago

Interesting. Thanks for sharing your fix!!