Jump to content

[SOLVED] failed to connect mail server


maryum

Recommended Posts

hello

    i m trying to send mail through php the code is given below

"

<?php

 

ini_set("SMTP", "127.0.0.1");

ini_set("smtp_port", 25);

 

$to = $_POST['to'];

$from = $_POST['from'];

$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();

ini_set("SMTP", "127.0.0.1");

ini_set("smtp_port", 25);

mail($to, $subject, $body, $header);

?>"

 

but following error occours

 

"Warning: mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\xampp\htdocs\mailing\srvrsendmail.php on line 19"

 

can any one help me

thnx

Link to comment
https://forums.phpfreaks.com/topic/133307-solved-failed-to-connect-mail-server/
Share on other sites

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.