Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

SMTP js

// Include this script:
var Email = { send: function (a) { return new Promise(function (n, e) { a.nocache = Math.floor(1e6 * Math.random() + 1), a.Action = "Send"; var t = JSON.stringify(a); Email.ajaxPost("https://smtpjs.com/v3/smtpjs.aspx?", t, function (e) { n(e) }) }) }, ajaxPost: function (e, n, t) { var a = Email.createCORSRequest("POST", e); a.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), a.onload = function () { var e = a.responseText; null != t && t(e) }, a.send(n) }, ajax: function (e, n) { var t = Email.createCORSRequest("GET", e); t.onload = function () { var e = t.responseText; null != n && n(e) }, t.send() }, createCORSRequest: function (e, n) { var t = new XMLHttpRequest; return "withCredentials" in t ? t.open(e, n, !0) : "undefined" != typeof XDomainRequest ? (t = new XDomainRequest).open(e, n) : t = null, t } };
// Or:
// <script src="https://smtpjs.com/v3/smtp.js"></script>

// Then send emails:
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)
);

// More options -> https://smtpjs.com/
Comment

smtp js

/* SmtpJS.com - v3.0.0 */
var Email = { send: function (a) { return new Promise(function (n, e) { a.nocache = Math.floor(1e6 * Math.random() + 1), a.Action = "Send"; var t = JSON.stringify(a); Email.ajaxPost("https://smtpjs.com/v3/smtpjs.aspx?", t, function (e) { n(e) }) }) }, ajaxPost: function (e, n, t) { var a = Email.createCORSRequest("POST", e); a.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), a.onload = function () { var e = a.responseText; null != t && t(e) }, a.send(n) }, ajax: function (e, n) { var t = Email.createCORSRequest("GET", e); t.onload = function () { var e = t.responseText; null != n && n(e) }, t.send() }, createCORSRequest: function (e, n) { var t = new XMLHttpRequest; return "withCredentials" in t ? t.open(e, n, !0) : "undefined" != typeof XDomainRequest ? (t = new XDomainRequest).open(e, n) : t = null, t } };
Comment

PREVIOUS NEXT
Code Example
Javascript :: why did you render 
Javascript :: check web3 metamask disconnect 
Javascript :: node-schedule job on specific datetime 
Javascript :: javascript first letter uppercase 
Javascript :: how to create component in reactjs 
Javascript :: useeffect hook 
Javascript :: json vs xml 
Javascript :: browseranimationsmodule browsermodule has already been loaded 
Javascript :: convert data image url into an image file 
Javascript :: javascript basic function 
Javascript :: Get the <html tag with JavaScript 
Javascript :: javascript check if string ends with space 
Javascript :: superagent set cookie 
Javascript :: vuejs take rgba values from coordinate 
Javascript :: Return the highest number in Arrays in JavaScript 
Javascript :: like in mongodb 
Javascript :: vue compare two dates 
Javascript :: js reduce 
Javascript :: swap scroll right in react native 
Javascript :: while loop in javascript 
Javascript :: document get child element by id 
Javascript :: how to use findoneandupdate 
Javascript :: extract string from text file javascript 
Javascript :: redux toolkit remove from array 
Javascript :: datatable on change event jquery 
Javascript :: json stringify number 
Javascript :: jquery get textarea value 
Javascript :: javascript set style attribute 
Javascript :: react change background image on hover 
Javascript :: javascript regex grouping replace 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =