Jump to content

Whilst everybody is talking about mailing!


chiprivers

Recommended Posts

I have not used the mail() function before within PHP and wondering where I should get started.  I am OK with the use of mail() but not sure what I need to do to get server ready.  I have BigApache installed on my computer for testing my scripts and I believe it is installed with Mercury mail.  What do I need to do to get it ready to send mail?

I am running this little test script:

<?php

$result = mail("[email protected]","Test Message","Hello");

if ($result) {
echo "accepted";
} else {
echo "failed";
}

?>

At the moment I am just getting "failed".
Ya I'm trying to figure out more on the msil function myself  ;D

Try this code instead.  ;)

<?php

$to = "[email protected]";
$subject = "email function" ;
$message = "Hi" ;
$from = "[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.