PHP Mail Function Still Not Working

Status
Not open for further replies.

dusmar93

New Member
Messages
19
Reaction score
0
Points
0
The PHP mail function is still not working on my site. No one can receive registration emails.

Here is my site info:
  • Domain: wilsonwesthh.elementfx.com
  • Hosting Server: starka
Any idea what is going on? Is it a setting that I need check on? It was working when I first setup my Wordpress site and now it hasn't worked for a week. Any idea when this could get fixed? I don't mean to be a pain but I need to demo my site to a bunch of teachers by the end of the week. If the site works, I will probably move to a paid hosting account with x10. If not, I will have to move the site.

Thanks
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Try this script.
The From must be an address on your account. It cannot be a hotmail or gmail account.
PHP:
//  TEST OF THE MAIL SYSTEM USING PHP mail()

date_default_timezone_set('America/Los_Angeles');
echo date('l jS \of F Y h:i:s A'); 


$from = "FROM ACCOUNT ON YOUR SITE";
$to="TO ADDRESS"; 


$mailbody="Test message sent (PST): \n" . date('l jS \of F Y h:i:s A');
$subject="Test of PHP mail()" ;

$headers = "Content-type: text/plain; charset=windows-1251 \r\n";
$headers .= "From: $from\r\n";
$headers .= "Reply-To: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();

$resp = mail($to, $subject, $mailbody, $headers);

if( $resp ){
    $outcome = "Mail sent" ;
} else {
    $outcome = "Mail not sent";
}

print "\nThe mail system said: $outcome\n\n" ;
exit();
 

dusmar93

New Member
Messages
19
Reaction score
0
Points
0
Ok. I think I got it now. Thank you very much for the script! It was very helpful


thanks again!
 
Status
Not open for further replies.
Top