PHP Mail

Status
Not open for further replies.

tropic81

New Member
Messages
20
Reaction score
0
Points
0
is it enabled?
Can it be enabled?
What other options do I have (if any) for my site sending automated emails or registration and forum subscriptions?

Thanks.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
PHP:
<?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'); 
echo " ... testing the mail() function " ;

$from = "YOURACCOUNT@YOURDOMAIN.x10.bz"; // MUST BE LEGIT ACCOUNT ON YOUR DOMAIN
 
$to="TARGET_ADDRESS@hotmail.com" ; // CURRENTLY, not blocked by hotmail!

$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"; // MUST BE text/plain 
$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();


?>

mail_test.php

Try it on your server. It works on Chopin for me. Both from the web and as a cron job.
 
Status
Not open for further replies.
Top