简体   繁体   English

Heroku上的基本Node.js应用程序 - 免费发送电子邮件的方式?

[英]Basic Node.js app on Heroku - free way to send emails?

I am making a basic web app on Heroku and want to be able to send basic emails. 我正在Heroku上制作一个基本的网络应用程序,并希望能够发送基本的电子邮件。 I am coming from PHP but trying to write this one in node.js. 我来自PHP,但试图在node.js中写这个。 I am used to PHPMailer. 我习惯了PHPMailer。 I have a gmail account that I want to send a certain email from every time a certain page is accessed. 我有一个Gmail帐户,我希望每次访问某个页面时都会发送一封电子邮件。 Nodemailer and postmark all seem to have costs associated - is there a 100% free option that I could use to send from Gmail? Nodemailer和邮戳似乎都有相关的成本 - 我可以使用从Gmail发送的100%免费选项吗? Else I may just do this in PHP. 否则我可能只是用PHP做到这一点。

Thank you 谢谢

Add a POST endpoint to your Node router to submit the data to be used to create a message and use a library with support for SMTP with TLS/SSL security like emailjs to send standard SMTP emails via accounts like Gmail (you will need to enable third party apps in the security settings for the Gmail account). POST端点添加到Node路由器以提交用于创建消息的数据,并使用支持SMTP和TLS / SSL安全性的库(如emailjs)通过Gmail等帐户发送标准SMTP电子邮件(您需要启用第三个Gmail帐户安全设置中的派对应用)。 There is likely more than one library option but I am recommending one that I've used for a few years myself: 可能有多个库选项,但我建议我自己使用了几年:

emailjs Lib for Node emailjs Lib for Node

https://www.mailgun.com/ is a service similar to postmark. https://www.mailgun.com/是一种类似于邮戳的服务。 They provide a simple REST API to send email and their free plan allow you to send 10,000 emails per month. 它们提供了一个简单的REST API来发送电子邮件,他们的免费计划允许您每月发送10,000封电子邮件。 Depending on the volume you want to send, this can be a viable solution for you. 根据您要发送的音量,这可能是一个可行的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM