| | |
PHP Mail Error
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello,
I am trying to send an email through php using the mail() function but getting the following error:
My PHP Code is:
FYI: I am running this code on windows 2003 server and i can send email using Horde.
What I am guessing is I need to add smtp authentication in my php code, so If you can tell me what is the syntax that can help me.
Does anyone know how to overcome this problem?
Thanx
I am trying to send an email through php using the mail() function but getting the following error:
PHP Syntax (Toggle Plain Text)
Warning: mail() [function.mail]: SMTP server response: my-server-name-here [my-ip-address-here] is currently not 550-permitted to relay through this server. Perhaps you have not logged into 550-the pop/imap server in the last 30 minutes or do not have SMTP 550 Authentication turned on in your email client.
PHP Syntax (Toggle Plain Text)
<?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>
FYI: I am running this code on windows 2003 server and i can send email using Horde.
What I am guessing is I need to add smtp authentication in my php code, so If you can tell me what is the syntax that can help me.
Does anyone know how to overcome this problem?
Thanx
I may be wrong, but I think there is no way you can authenticate to a mail server using just the mail() function in php.
You should set your server to allow emails from localhost/ local IP without authentication.
I use phpMailer class from here: http://phpmailer.sourceforge.net/
It is open source and has a lot of functionality, including authentication on smtp servers.
You should set your server to allow emails from localhost/ local IP without authentication.
I use phpMailer class from here: http://phpmailer.sourceforge.net/
It is open source and has a lot of functionality, including authentication on smtp servers.
![]() |
Similar Threads
- PHP mail() (Sendmail) Problem :( (PHP)
- PHP e-mail SMTP error ??? (PHP)
- PHP Parse error: parse error, unexpected T_STRING (PHP)
- php mail form - need to redirect to new page (PHP)
- how do you setup php mail()? using sendmail and yellowdog linux w/apache and php4 (*nix Software)
- Php parser error when xml version is mentioned (PHP)
Other Threads in the PHP Forum
- Previous Thread: Template
- Next Thread: help with preg match
| Thread Tools | Search this Thread |
advanced apache api array beginner binary broken cakephp check checkbox class cms code cookies cron curl database date datepart display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google head href htaccess html if...loop image include includingmysecondfileinthechain insert ip javascript job joomla jquery js key library limit link login mail menu mlm multiple mysql oop password paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search server sessions smarty sms sorting source space sql stored syntax system table traffic tutorial unicode update upload url validator variable video web youtube zend





