Advertisement
Guest User

Untitled

a guest
Jan 9th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. /* SmtpJS.com - v2.0.1 */
  2. Email = {
  3. send: function(e, o, t, n, a, s, r, c) {
  4. var d = Math.floor(1e6 * Math.random() + 1),
  5. i = "From=" + e;
  6. i += "&to=" + o, i += "&Subject=" + encodeURIComponent(t), i += "&Body=" + encodeURIComponent(n), void 0 == a.token ? (i += "&Host=" + a, i += "&Username=" + s, i += "&Password=" + r, i += "&Action=Send") : (i += "&SecureToken=" + a.token, i += "&Action=SendFromStored", c = a.callback), i += "&cachebuster=" + d, Email.ajaxPost("https://smtpjs.com/v2/smtp.aspx?", i, c)
  7. },
  8. sendWithAttachment: function(e, o, t, n, a, s, r, c, d) {
  9. var i = Math.floor(1e6 * Math.random() + 1),
  10. m = "From=" + e;
  11. m += "&to=" + o, m += "&Subject=" + encodeURIComponent(t), m += "&Body=" + encodeURIComponent(n), m += "&Attachment=" + encodeURIComponent(c), void 0 == a.token ? (m += "&Host=" + a, m += "&Username=" + s, m += "&Password=" + r, m += "&Action=Send") : (m += "&SecureToken=" + a.token, m += "&Action=SendFromStored"), m += "&cachebuster=" + i, Email.ajaxPost("https://smtpjs.com/v2/smtp.aspx?", m, d)
  12. },
  13. ajaxPost: function(e, o, t) {
  14. var n = Email.createCORSRequest("POST", e);
  15. n.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), n.onload = function() {
  16. var e = n.responseText;
  17. void 0 != t && t(e)
  18. }, n.send(o)
  19. },
  20. ajax: function(e, o) {
  21. var t = Email.createCORSRequest("GET", e);
  22. t.onload = function() {
  23. var e = t.responseText;
  24. void 0 != o && o(e)
  25. }, t.send()
  26. },
  27. createCORSRequest: function(e, o) {
  28. var t = new XMLHttpRequest;
  29. return "withCredentials" in t ? t.open(e, o, !0) : "undefined" != typeof XDomainRequest ? (t = new XDomainRequest).open(e, o) : t = null, t
  30. }
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement