The mail function uses the specified SMTP mail server to send out the mail.
you will need to set the php.ini variables as follows
SMTP = localhost ; The name or IP address of the
machine which is running
the SMTP Server. for ex ;
mail.flashmail.com
sendmail_from = [EMAIL PROTECTED] ; The address that you want to appear
in
the From Field of the mail.
The error you are getting is most probably because of the fact that there is
no SMTP server running on the machine specified in the above SMTP setting.
take a look at the following link for more info on the mail function -
http://www.php.net/manual/en/function.mail.php
hope that helps
regards
Ankur Verma
HCL Technologies
Noida
Uttar Pradesh
India
-----Original Message-----
From: Sonya Davey / QDCEL [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 2:25 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] Problem with mail function
Hi, Can anyone help me the mail function.
I am using PHP 4.04, on Windows 98,with PWS.
1.What must I configure thse settings in my php.ini file to?
SMTP = localhost
sendmail_from = [EMAIL PROTECTED]
2.Why does this code give me the following error?
Warning: Failed to Connect
Code:
$to = '[EMAIL PROTECTED]';
$from = '[EMAIL PROTECTED]';
$body = $MainAgentCode;
$headers = "From: $from";
$success = mail($to, "Inpro Web site", $body, $headers);
if ($success)
{//begin
echo "<B><CENTER>Thank you for your input</CENTER></B>\n";
}//end
e{
echo "Error \n";
}
Thanks to anyone who can help.
Sonya
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]