I had my web.config
mail section like that:
<smtp from="mail@gmail.com">
<network enableSsl="true" host="smtp.gmail.com" port="587" userName="mail@gmail.com" password="pwd" />
</smtp>
Tested locally, but I got an error on production(i am using shared hosting environment):
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
I googled I find out possible solution, so I changed my configuration as:
<smtp from="mail@gmail.com">
<network enableSsl="true" host="smtp.gmail.com" port="587" userName="mail@gmail.com" password="pwd" defaultCredentials="true"/>
</smtp>
And now I got this error:
he SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. ko10sm114859924pbd.38 - gsmtp
How can I fix that?
I also tied to add delivery method:
<smtp from="mail@gmail.com" deliveryMethod="Network">
<network enableSsl="true" host="smtp.gmail.com" port="587" userName="mail@gmail.com" password="pwd" defaultCredentials="true"/>
</smtp>
But ho way.
UPDATE
I just checked my gmail and find out email from google
Someone recently used your password to try to sign in to your Google Account xxxxxxx@gmail.com. This person was using an application such as an email client or mobile device.
We prevented the sign-in attempt in case this was a hijacker trying to access your account. Please review the details of the sign-in attempt:
Monday, January xxx.xxx UTC IP Address: xxx.xxx.xxx.xxx Location: Unknown
So may be it is the reason why email send not working on production.
Because it is a new location and when you sign in from a new location on gmail
you should answer security questions. So it make scene then why email is not working.
So i am looking now how to unblock that locaton/ip address on gmail
if it is possible.