Skip to content

Instantly share code, notes, and snippets.

@gbrennon
Last active November 24, 2015 16:44
Show Gist options
  • Save gbrennon/8b06cc84804aadbe366e to your computer and use it in GitHub Desktop.
Save gbrennon/8b06cc84804aadbe366e to your computer and use it in GitHub Desktop.
Funcao para envio de email através da API fastemail
function enviaEmail(emailData) {
$.ajax({
type: "POST",
url: "http://fastemail.herokuapp.com/mail",
data: JSON.stringify(emailData),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
cache:false,
async: false,
success: function(data){
alert("Dados enviados com Sucesso!");
limpaCampos();
},
error: function(data){
alert(data);
}
});
}
var emailData = {"receiver": "EMAIL DESTINATÁRIO", "subject": "string contendo assunto!", "content": "STRIGN CONTENDO MENSAGEM"};
enviaEmail(emailData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment