I am getting following exception while implementing mail feature for my local machine please help me with this
The 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. 21sm1768418wfi.5
It’s exactly as the message describes.
What ever SMTP server you’re trying to connect to, requires you to use SSL for that connection, in addition to supplying a username&password.
SMTP over SSL typically occurs on port 465, however you will need to verify this setting with your mail provider.
So you need to specify the correct port, and specify the UseSSL flag.
Using C# it might look like this: