Hi I am trying to send an email after a user enter some contact data but it seems that the email does not get sent as expected.I do not work with php very often so I might have missed something.Here is my code:
function sendEmail($data){
$to = 'alexandru.nistor.89@gmail.com';
$subject = 'From My Portfolio Website!';
$message = $data[3]['value'];
$headers = 'From: ' . $data[0]['value'] . " " . $data[1]['value'] . "\r\n" .
' Reply-To: '. $data[2]['value'] . "\r\n";
mail($to, $subject, $message, $headers);
}
Now before you ask the function gets called I have checked with the debugger and the data is added corectly to the variables the only problems is that the mail does not arive to the destination.Am I doing somethign wrong?
Check what function
mail()returns.If returns
falseit means it’s error in php. If it returnstrueit means it is accepted for delivery but not necesery will reach its destination. In this case it’s more network related.More info at docs: http://php.net/manual/en/function.mail.php