PDA

View Full Version : mail() function


m@l@y@
05-24-2006, 02:22 PM
hol7even:
i'm trying to send out emails, only my colligues can receive em' (they can't be sent outside): what cud be the problem??
it keeps on giving me "Warning: Server Error".OR maybe it might be because my colligues uses the same mail-server as mine..

been using:
<?php
$email = "lmpofu@fnb.co.za";


$to = "malaya@studentvillage.co.za";
//$headers = "To: Bob <kagiso@po.gov.za>\r\n";
$headers = "From: $email\r\n";
$headers .= "Bcc: kagiso@po.gov.za\r\n";

$result = mail($to, "Hi?", "So do you know this Kagiso guy", $headers);

if ($result) {
echo "Your message has been sent! ";
echo "Return to <a href='home.html'>home</a> page.";

} else {
echo "There was an error!";
}
?>

fci
05-24-2006, 02:57 PM
if the email bounced back, copy and paste everything from it unless all it said was 'warning: server error' ..

d11wtq
05-24-2006, 11:28 PM
Have a shot with this. mail() doesn't really reveal a lot about where the problems are, it also uses a lot of resources for such a simple task.

http://forums.devnetwork.net/viewtopic.php?t=48055

This class allows you to specify an SMTP server and use authentication if needed... you can look at all the data that was sent for a clear indication of any problems with the network/permissions.

Hope it helps :)