user514310
user514310

Reputation:

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 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

Thanks

Upvotes: 0

Views: 3601

Answers (3)

symcbean
symcbean

Reputation: 48387

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.

Upvotes: 0

bcosca
bcosca

Reputation: 17555

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.

Upvotes: 0

Dmitriy
Dmitriy

Reputation: 2822

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

Upvotes: 2

Related Questions