RE: [PHP] Problem with mail function
| From: | Ankur Verma | Date: | Mon, 26 Mar 2001 10:33:29 +0000 |
| Subject: | RE: [PHP] Problem with mail function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45597@lists.php.net to get a copy of this message | ||
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 = me@localhost.com ; 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:SonyaD@PQAfrica.co.za]
Sent: Monday, March 26, 2001 2:25 PM
To: 'php-general@lists.php.net'
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 = me@localhost.com
2.Why does this code give me the following error?
Warning: Failed to Connect
Code:
$to = 'support@here.co.za';
$from = 'sonyad@pqafrica.co.za';
$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: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net