Can I send email using javascript

后端 未结 6 1787
日久生厌
日久生厌 2021-01-04 09:11

Is it possible to send emails using just javascript?

6条回答
  •  渐次进展
    2021-01-04 09:30

    EDIT: [WARNING!] README:

    It's a third party library that connects to an external server, take care with the information that you are sending.


    Another solution on JS you can use a library named smtpjs

    Add following library your html on header:

    
    

    Use this without security:

    Email.send("from@you.com",
    "to@them.com",
    "This is a subject",
    "this is the body",
    "smtp.yourisp.com",
    "username",
    "password");
    

    Use this with security:

    Email.send("from@you.com",
    "to@them.com",
    "This is a subject",
    "this is the body",
    {token: "63cb3a19-2684-44fa-b76f-debf422d8b00"});
    

提交回复
热议问题