Skip to content

Instantly share code, notes, and snippets.

@ozknozsrt
Created July 6, 2020 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozknozsrt/c8c55143fb48f3c53016472a5e7f941d to your computer and use it in GitHub Desktop.
Save ozknozsrt/c8c55143fb48f3c53016472a5e7f941d to your computer and use it in GitHub Desktop.
Smtp JS
<!-- SmtpJs -->
<script src="https://smtpjs.com/v3/smtp.js"></script>
<script>
$('.btn-submit').click(function () {
/*var maillist = [
'****@***.com',
'****@***.com',
];*/
Email.send({
SecureToken: "tokencode",
To: 'to@mail.com',
From: 'from@mail.com',
Subject: "Contact Form",
Body: 'Name: ' + $('#name').val() + '<br> Phone: ' + $('#phone').val() + '<br> Message: ' + $(
'#message').val()
}).then(
message => alert('Your form has been submitted successfully.')
);
return false;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment