hallo there, i want to send mail. i get what i need from a form. the code to send the mail is else { /*echo $email_address; echo "<br>"; echo $subject; echo "<br>"; echo $message; echo "<br>"; echo $headers; echo "<br>";*/ if(mail($email_address, $subject, $message, $headers)) { //echo 9 never in here; header("Location: ".$form_file."?msg=7");} else { header("Location: ".$form_file."?msg=8"); } //echo 11; } Code (markup): all the parametres of mail function is full with the right data. but the if condition is never true. it nevers sends the mail. Am i doing something wrong????
someone?????? is it possible that server side setting?. i should communicate with the web server administrator???
can we see the $headers? maybe: $success = mail($email_address, $subject, $message, $headers); if (!$success){ //echo 9 never in here; header("Location: ".$form_file."?msg=8"); } else { header("Location: ".$form_file."?msg=7"); } Code (markup):
Try to email something to your email like this mail("youremail@domain.com","Test Email", "Test Message"); instead of "youremail@domain.com" set your email
@s_ruben, the original poster is using variables in the form that is why he cannot just use mail("youremail@domain.com","Test Email", "Test Message"); Code (markup):
mail("youremail@domain.com","Test Email", "Test Message"); Code (markup): It is only for checking the server. Maybe the server doesn't send emails at all.