Script mail does not work

I am stuck and cannot understand all my life why this does not work. He worked before. I changed the email addresses below for security reasons.

$to = "email@domainname.com";
$subject = "Submission";
$body = "Test Body";
$header = "From: email@domainname.com";                
if (mail($to, $subject, $body, $header)) {
    echo "message was successfully sent.";
    echo "$to $subject <br/> $body <br/> $header";
} else {
    echo "There was a Problem.";
};
+3
source share
2 answers

I looked at our mail server and changed the spam filter settings to see what happens. Low, and now everything is working fine. It is strange that he did not show that the letter was even received. But regardless of the solution to the problem. Thanks to everyone for their help, this is valuable.

0
source

At first . You must be sure that your ambiente is set up correctly. Your script will also not display error messages.

: PHPMailer. (Http://phpmailer.worxware.com/) , , .

!: , , . , .

PHPMail , , , , .

, PHPMail !

, .

0

All Articles