代码之家  ›  专栏  ›  技术社区  ›  Ali Abdulaal

如何使用SMTP发送电子邮件在爱奥尼亚3?

  •  0
  • Ali Abdulaal  · 技术社区  · 6 年前

    我正在尝试使用Gmail SMTP发送电子邮件。我检查了这么多的解决方案,但都没用。

    今天我发现了这个网站 https://www.smtpjs.com/ 这可能有助于我解决我的问题,但我需要帮助知道我应该把这一HTML行:

    <script src="https://smtpjs.com/v2/smtp.js"></script>
    

    电子邮件 在我的 要使用此代码:

    Email.send("from@you.com",
    "to@them.com",
    "This is a subject",
    "this is the body",
    "smtp.yourisp.com",
    "username",
    "password");
    
    1 回复  |  直到 6 年前
        1
  •  2
  •   Fatihd    6 年前

    如果你有这样的按钮发送的话

    <button id="SendMessage">SEND MAIL</button>
    

    <script src="https://smtpjs.com/v2/smtp.js"></script>
    <script>
    $("#SendMessage").on("click",function(){
    
    Email.send("from@you.com",
    "to@them.com",
    "This is a subject",
    "this is the body",
    "smtp.yourisp.com",
    "username",
    "password",
    function done(message) { alert("This area for after mail send.") }
    );
    
    });
    </script>