Hi all,
I have contact form in html page. I have 3 fields NAme,Message,Email. I want to send these data to another email. I try this with PHP as follows. It shows success message. But i am not receiving any mail. Can anyone help me to solve this.
script: 
Know the answer? 01
Arun PottiAnswers in the forums20answers02
Tahir AnsariAnswers in the forums5answers03
Kamlesh KumarAnswers in the forums5answers04
Sam HobbsAnswers in the forums4answers05
Željko PerićAnswers in the forums3answersFull leaderboard →
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
$(document).ready(function(){
$('#submit').click(function(){
var name=$('#name').val();
var email=$('#email').val();
var message=$('#message').val();
var vardata = 'name=' + name + '&email=' + email + '&message=' + message;
console.log(vardata);
alert(vardata);
$.ajax({
type: "POST",
url: 'send_mail.php',
data: vardata,
success: function () {
alert(vardata);
alert("success");
}
});
});
});
Form:
Please enter name
E-mail is not a valid format
Please enter message
E-mail was successfully sent.
There was a problem validating the form please check!
The connection to the server timed out!
May 6, 2015, 4:18 AM EDT
Probably a problem with your SMTP server?
Do you need to send your authentication key/value pair (username/password) also? If your server requires, then yes. You do need to send these values before you can send the email through their server.
Do you need to send your authentication key/value pair (username/password) also? If your server requires, then yes. You do need to send these values before you can send the email through their server.
Hi Ahmed,
Thanks for your reply. Our server is an exchange server not an SMTP server. Is there need to give credentials for exchange server
Thanks for your reply. Our server is an exchange server not an SMTP server. Is there need to give credentials for exchange server

Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister