Sending an Email on Form Submission

would like to know how this looks with an gmail account.
did some reading but, cant get nowhere.

tnx hans

Hi Hans,

In the How-to article ’ How to Send an Email on Form Submission ’ we demonstrate the process using Sendgrid api. Gmail also provides a similar api which you can see here

Feel free to let us know if you have any specific questions regarding the process.

yep , saw this but, i am afraid it does not help me, think its one step to high for me this moment
but i got the google api key, so i am on my way to … who will tell

tnx for the comment

Where did you get the google api key at?

NVM I found it. However what did you use for the API url?

Hans, if you haven’t already gotten the email through gmail working yet, I’d love to collaborate with you so we can figure it out for everyone and get it working. If you are interested you can contact me @ pdonn3@terpmail.umd.edu.

Hi Patrick would like some help, this moment i am working on other issue, maar but contact you when i am back on this problem

Hello! I trying to send an email via gmail using the exemple in the article ‘How to Send an Email on Form Submission’. I have already get the google’s API key but I don’t know whicth url to use for a query with an API key (google’s documentation is not so clear for me).

Hi Everyone,
I found great tutorials about how to send emails with GMAIL API with Javascript. Im implementing it right now, I’ll keep you posted…

Please take a look:

Hey Luigino,

Thanks for the links!

Have you found a solution yet?

Hello,
I’m interested in this as well. I’m trying to implement it.

Did anyone get anywhere with this? Would be keen to have some info if so :slight_smile:

I need info on this as well.

Have a look at this article: https://girizano.wixsite.com/codecorner/home/send-email-thru-gmail-and-others-in-wix-code

Thanks Giri Zano for the info. However, from your article, if “emailJS” provides 200 free email per month (about 2400 per year) and “MailGun” provides 10,000 free email per year, isn’t MailGun a better option?
Interested to know why you choose “emailJS” instead of “MailGun”, is it because of better service or other reason? Thanks

emailjs developed many interfaces onto email providers. So if you use emailjs with gmail, your email first goes to emailjs and they send it thru gmail. If you choose mailgun, the same: first thru emailjs, then to mailgun. In short, emailjs is “the man in the middle”, you ALWAYS go thru them first, they resolve all the API-problems connecting to an email provider of your choice and THEN the email provider (mailgun/gmail/outlook) sends the email. So if mailgun offers 10000 and emailjs 2400, you will only be allowed to send 2400 emails using emailjs (on the free account) using mailgun. Does that make sense?

thanks for quick response, sorry if my question sounds dumb as I am new to this. What I don’t understand is, from what I can see from MailGun web site, they also have Email API, so what’s the difference between sending through emailJS vs sending through MailGun if both companies provide API to send email out? Would you be so generous and provide a second tutorial using MailGun as example so we can compare between the two? Much appreciated for your assistance.

also, a correction, from MailGun web site(Reliable Email API that Integrates into Your App | Mailgun), looks like it’s “first 10,000 email free per month”, not per year.

I was able to setup EmailJS easily following Giri Zano’s instruction, and it works in the first test. The instruction is very clear and easy to follow. Thanks Giri Zano for the great work!

I think there’re still some extra work required from emailJS team as the following message from Gmail is a bit discouraging when I tried to add Gmail as service into EmailJS…

A few updates:

  1. I signed up to MailGun, and realised it’s slightly different from EmailJS. My basic initial study shows with EmailJS, you use their API to send email from WIX code after you setup Gmail (or other email provider) as your provider, plus a template. With MailGun first you have to setup your own domain (e.g. yourcompany.com) and need to setup DNS record to show you actually own that domain, then you can use their API to send email from your domain. This is obviously different from EmailJS and not suitable for me.

  2. I also tried the Google APIs (JavaScript quickstart  |  Gmail  |  Google for Developers) but can’t get it to work properly on my Windows 7 work laptop after a few tests. Their github (https://github.com/gsuitedevs/browser-samples/tree/master/gmail/quickstart) shows the code was recently updated - just 6 days ago… Already raised issue and hopefully it gets fixed quickly.

[Update1] I later tried the same code from Google on Chrome from my MacBook and it worked, so looks like this might be related to the corporate AD policy forcing third party cookies to be blocked (or other chrome settings?)? Plus, not sure how to port that over to WIX…

  1. also tried the other example using Google Gmail API (Mastering Your Inbox with the Gmail JavaScript API — SitePoint) and that worked too on my MacBook. But not sure how to port that over to WIX, looks like lots of work?

So unless anyone has better idea, I think I will stay with EmailJS until I can find better options.