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.14k stars 910 forks source link

Mail is no longer delivered #447

Open tumise100 opened 1 year ago

tumise100 commented 1 year ago

I have been using this for my personal website, and I noticed mail are been deliver to email when people use my contact form. It's not functioning at all

nelsonic commented 1 year ago

Hi @tumise100, 👋 Are you able to send email from the email address manually? i.e. using the GMail web interface? ✉️

tumise100 commented 1 year ago

Yes, I'm able to send out mail from the account

nelsonic commented 1 year ago

Hmm … strange. Google might be blocking the script. Are you able to email yourself using the script? 💭

tumise100 commented 1 year ago

How do I do that? emailing myself with the script

nelsonic commented 1 year ago

@tumise100 is your script public? It should already be configured to send the email to yourself: https://github.com/dwyl/learn-to-send-email-via-google-script-html-no-server/blob/6b1122f7805dba5bb48150a0ca8d000b12032884/google-apps-script.js#L56 i.e. when the form is submitted, it should send an email to the TO_ADDRESS

tumise100 commented 1 year ago

Yeah... but not working, when the form is submitted, nothing happens, no mail sent, no mail receive

cristianofromagio commented 1 year ago

I just setup a test following the tutorial and it worked fine. Have you checked if there is any failed executions for your AppScript? You can check it here (this is the script editor page, when you click the script from the list at https://script.google.com/home or through the Sheets file Extensions -> Apps Script menu): image You can refer to https://developers.google.com/apps-script/guides/support/troubleshooting?hl=en for troubleshooting any error.

But if it seems to be nothing wrong there (and you are sure you didn't consume all the free quota), you can try Redeploying your script as in Step 5 of the tutorial. Don't forget to also update your <form action=""> with the new Web app URL.