SMTP Mail in PHP/Linux
Posted: Mon Apr 07, 2003 7:56 am
Dear All,
I Have an Requirement where i need to pass the mail server name dynamically for php mail, I know it is possible but don't know exactly how it works.
Iam working with php on Linux, Here is a simple Code Iam using for mail
*****************************
$to = "kattasrinivas@etisbew.com";
$subject = "Test";
$message ='Test';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: kattasrinivas@etisbew.com\r\n";
if(mail($to, $subject, $message,$headers)) {
echo "Mail Sent";
} else {
echo "Mail Not Sent" ;
}
***************************************
In the above Program I need to pass the mail server name dynamically, By default the mail server is considered as localhost
Any help in thsi regard is highly appreciated
I Have an Requirement where i need to pass the mail server name dynamically for php mail, I know it is possible but don't know exactly how it works.
Iam working with php on Linux, Here is a simple Code Iam using for mail
*****************************
$to = "kattasrinivas@etisbew.com";
$subject = "Test";
$message ='Test';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: kattasrinivas@etisbew.com\r\n";
if(mail($to, $subject, $message,$headers)) {
echo "Mail Sent";
} else {
echo "Mail Not Sent" ;
}
***************************************
In the above Program I need to pass the mail server name dynamically, By default the mail server is considered as localhost
Any help in thsi regard is highly appreciated