views:

122

answers:

2

hi,

I am here to find and suppy smtp credentials if required to the mail server. But how can i know whether my server requires it or not?

I am scripting in PHP and using PHPMailer

+1  A: 

Well, if it truly is "your" server, then you should know how you configured it. If it is not, and that information is not supplied to you, then try sending a test mail without credentials. If it works, voila!

If you mean how to generically discover from PHP whether the mail server needs credentials, that should not be your job. It should be up to the user to configure.

Jakob Kruse
Agreed. You should know pretty quickly when you get a relay denied error if you try sending without credentials.
d11wtq
I got error message like receipt failed
KoolKabin
"Recipient failed" means when you're not authenticated you can only send mail locally, or not at all. In other words, it means you have to log in first.
Jakob Kruse
+2  A: 

Simple... have PHPmailer attempt to send an email without credentials. If the email's rejected for lack of credentials, ->Send() will return an error and you can look at $ErrorInfo for the details.

If authentication is required, then generally the send attempt will be rejected with SMTP Error 530.

Marc B
Its showing receipnt failed
KoolKabin
Most like you're trying to relay a mail, which means you need to use credentials. And hopefully the SMTP server is configured to allow relaying for authenticated users.
Marc B