Send email using php in windows server
I'm trying to send email in windows server using PHP. When I use php mail function. then i get following error message.
Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authenticatio开发者_JS百科n 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
Thanks
I'm not an expert on windows server but you can always send message through an SMTP server where you have an email using special php classes like this one http://www.phpclasses.org/package/346-PHP-A-class-to-enable-you-to-send-email-direct-through-an-smtp-server-.html
You should have your SMTP server configured to allow relaying of messages for privileged IP ranges. Otherwise, you'll have to add authentication to your code.
The answer is in the error message you are getting.
The original specs for SMTP required no authentication to forward messages, however the explosion of spam means that there have been lots of formal extensions to the protocol, and lots of non-standard ways of trying to solve the spam problem. Out of the box, PHP does not support SMTP authentication.
There are lots of libs/add-ons out there which fix this and other mail-related problems, phpmailer is a popular solution.
精彩评论