Sending Email using Gmail

How i can use my gmail for sending email using meteor? i already tried mailgun and it is easy to integrate, but as of this day i want to use gmail instead of mailgun. and i already tried to search to google on how i can configure my gmail to work, but still no luck. any help?

Itā€™s covered pretty well here. Just set the MAIL_URL environment variable with your gmail details:
e.g.

MAIL_URL=smtp://your-address%40gmail.com:your-password@smtp.gmail.com:465/

and then use

Email.send

Note: you might have to fiddle with your gmail settings to allow your account to be used as a smtp server.

2 Likes

but Iā€™d recommend a transactional email service like mailgun (we use mandrill). Itā€™s faster to call an API than to wait for the email to send. You get better deliverabilityā€“ā€œinbox penetrationā€. Reports and metrics. Itā€™s easier to see which messages were undelivered. With gmail you are limited to 100-200 sends per day when not using the web interface.

You can set it up with your own domain with mailgun:
http://mailgun-documentation.readthedocs.io/en/latest/quickstart-sending.html#verify-your-domain

3 Likes

I had trouble once with G Suite blocking a message I was trying to send to my customers. Because the email mentioned pricing and a ā€œlaptopā€ they blocked it because it triggered a lottery and prize scam filter they had setup. So my legitimate ecommerce emails were not being delivered to my own customers because google thought it was a scam. I quickly migrated by transactional emails away from G-Suite. Itā€™s not an appropriate business-class service for transactional emails service in my opinion.

1 Like

Even though you technically can use their SMPT server for sending emails, it might be not smart to do. They can (and will) block messages if more messages than a specific quota are sent, or any suspicious behaviour is noticed. So far I tried Mailgun, and it works ok.

1 Like

As somewhat of an expert on email, Iā€™ll second (or third) the ā€˜donā€™t use GMAIL as a serverā€™ comments. In fact, donā€™t use any consumer email server to send transactional emails. They all have spam filters of one sort or another as well as rate limiters that will eventually bite you. Especially if you arenā€™t adding SPF and DMARC records to your email headers.

Mailgun is easy to set up and free for moderate usage. If you are sending more email than the free plan allows, using Gmail going to block your IP address and you wonā€™t even be able to access your own account. The only problem Iā€™ve had with mailgun, is that on the free plan they use a shared IP address to send from and some of those IP addresses are on various blacklists. If you complain, they will move you to a different shared IP which may or may not help, or you can subscribe to one of the paid plans that give you a private IP address. Mailgun also optionally supports Web callbacks for delivery and bounce notifications. I use the bounce callback to automatically keep my appā€™s email address database up to date.

Also note that if you are trying to connect to GMail or other SMTP server on port 25, there is a good chance that your local ISP will likely block the mail as their assumption is that you are some sort of spammer.

2 Likes