Link to home
Start Free TrialLog in
Avatar of Sanjay Gandhi
Sanjay GandhiFlag for India

asked on

PHP Mail

Hello,

I am trying this PHP code to send email. In an earlier attempt I was able to send mail properly but that was setting up PHP.ini setting.

In this attempt, I am trying to setup my smtp settings in the email program itself.

Attached is the new file.

Thanks,

San.
smtpmail.php
Avatar of Averitteg
Averitteg
Flag of United States of America image

Are you getting any errors??  What is the issue?
Avatar of Sanjay Gandhi

ASKER

Oh yes, I forgot to send the error I am facing:

Failed to set sender: noreply@kenhal.com [SMTP: Invalid response code received from server (code: 530, response: The SMTP server requires a secure connection or the client was not authenticated.(#5.7.1))]

Here is the problem.

- San.
have you enabled ssl?

You have 'auth' => false, yet the server is requiring authentication.
If I make it true, I get the following error: (I've tried various combinations, getting different errors, so I'll keep informing you about the errors). In fact, the pwd is N0Reply (case sensitive), so it may become easy for you. On the other hand, I am running Xampp, and the PHP.ini and sendmail.ini is also existing there as it is. Here is the error with Auth=True.

authentication failure [SMTP: Invalid response code received from server (code: 535, response: authorization failed (#5.7.0))]

I've not enabled SSL. It is none in my Outlook settings where this mail is working fine.

- San.
ASKER CERTIFIED SOLUTION
Avatar of Sanjay Gandhi
Sanjay Gandhi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I see that you did enable the auth=true.  I'm glad that it worked out for you.
Probably after lot of struggle, I could get the exact way I wanted this answer to work for my requirement. So after finding solution, I thought it was my duty to share the answer.