I’m using the following after submitting variables to a contact form.
// Success
success: function (html) {
if (html==1) {
// Loading icon
$('.loading').fadeOut('slow');
//show the success message
$('.success-message').slideDown('slow');
// Disable send button
$('#send').attr('disabled',true);
} else {
$('.loading').fadeOut('slow') alert('Sorry, unexpected error. Please try again later.');
}
}
After successfully sending the email though, I cant seem to trigger the success. I keep getting the “Sorry, unexpected error. Please try again” message even though the email sends. On the other end, I’ve got:
if(!$mail->Send()) {
echo "Your message could not be sent.";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
} else {
return 1;
}
What in the world am I doing wrong? I’ve been messing with this for hours!!!