Afan Pasalic wrote:
I have to develop a little registration form.
after the form is submitted confirmation email has to be sent to
registrant.
I use this function to send an email:
function send_plain_email($to, $subject, $body)
{
$headers = "MIME-Versin: 1.0\n" . "Content-type: text/plain;
charset=ISO-8859-1; format=flowed\n" . "Content-Transfer-Encoding:
8bit\n" .
"Reply-To: Registration <registration@xxxxxxxxxxxx>\n".
"From: Registration <registration@xxxxxxxxxxxx>\n" .
"X-Mailer: PHP" . phpversion();
mail($to, $subject, $body, $headers) or die(mysql_errno());
}
Though, I'm getting the following error:
Warning: mail() [function.mail]: SMTP server response: 503 This mail
server requires authentication when attempting to send to a non-local
e-mail address. Please check your mail client settings or contact your
administrator to verify that the domain or address is defined for this
server. in
D:\Sites\CWIPanel\Accounts\mydomain.com\wwwroot\reservation.php on line 34
Never get such a error using LAMP.
I'm assuming from that comment that you're running this under Windows of
some variety? This is not a PHP problem. The mail server PHP is
configured to use (see php.ini) requires authentication. The built-in
mail function doesn't support that so you'll need to use something like
PHPMailer (Google for it).
-Stut
--
http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php