Jump to content

[SOLVED] send mail to a real address


maryum

Recommended Posts

i have used the following code

 

<?

ini_set("SMTP", "127.0.0.1");

ini_set("smtp_port", 25);

 

$to = $_POST['to'];//[email protected]

$from = "admin@localhost";

$subj = $_POST['subj'];

$msg = $_POST['msg'];

$header = "MIME version: 1.0\r\n";

$header .= "Conttent-type:text/html;charset=ISO-8859-1\r\n";

$header .= "From:$from \r\n";

$header .= "Cc: $cc \r\n";

$header .= "Bcc: $bcc \r\n";

$header .= "Reply-to: <$from>\r\n";

$header .= "X-Mailer: PHP/".phpversion();

 

$mail_sent = mail($to, $subj, $msg, $header);

 

echo $mail_sent ? "Mail sent" : "Mail failed";

exit;?>

but following error occours

 

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in D:\xampp\htdocs\mailing\srvrsendmail.php on line 18

Mail failed

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.