Click here to Skip to main content
15,906,569 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I tried using the code/class [^]

to send mail using google smtp server, but was not successful until I logged in to my mail box and turned on ALLOW LESS SECURE APPS button.

But what I really want is to send mails without turning on the ALLOW LESS SECURE APPS button. How can I do this with the class. code above. What modification or addition do I need to carry out or add.

What I have tried:

I have done google searching to no avail.
Posted
Updated 18-May-17 20:42pm
Comments
[no name] 17-May-17 21:46pm    
You would need to ask google pretty please can you use their service without that setting.

If you could send email without that setting then what would be the point in the setting? It's like asking; "This door is locked and I don't have the key, how do I open the door anyway?"

This is just one of many reasons why you shouldn't send email via gmail

Things you shouldn't spend time doing | The ASP.NET Forums[^]
 
Share this answer
 
Comments
Gbenbam 19-May-17 2:40am    
See my solution below.
Use OAuth 2.0 [Details here]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900