前端發送郵件


公司網站沒有用到數據庫什么的,也沒用建站工具,

現在需要,收集客戶填寫的信息,發郵件,只能用前台發郵件了,所以找到了Smtp.js

https://www.smtpjs.com

  • 1. Include the script:
    <script src="https://smtpjs.com/v3/smtp.js">
    </script>
  • 2. Send an email using: 
    Email.send({
        Host : "smtp.yourisp.com",
        Username : "username",
        Password : "password",
        To : 'them@website.com',
        From : "you@isp.com",
        Subject : "This is the subject",
        Body : "And this is the body"
    }).then(
      message => alert(message)
    );

這種輸入明文密碼的是肯定不安全的,同時也提供的SecureToken 方式

Email.send({
    SecureToken : "C973D7AD-F097-4B95-91F4-40ABC5567812",
    To : 'them@website.com',
    From : "you@isp.com",
    Subject : "This is the subject",
    Body : "And this is the body"
}).then(
  message => alert(message)
);
其實這種也不安全,別人雖然不知道密碼了,但是可以用你的賬號發垃圾郵件啊


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM