How to securely send my credentials using smtpClient using ASP.Net

I have a page on my website that users can send messages to the site administrator. I use the email address that the server gave me to send a message to myself. I have no problem coding, but what bothers me is the credentials that I have to send to the server as follows:

System.Net.NetworkCredential myCredential = new System.Net.NetworkCredential("email", "password");
mySmtpClient.Credentials = myCredential;

I am sure this will send this information in clear text. How can I provide this? can this following code protect everything on my own?

smtpClient.EnableSsl = true;

this is some information that my server gave me. should i use them?

Proxy Settings Exchange Online https://webmail.myserver.com (Port 443)
Principal name Exchange Online: msstd: webmail.myserver.com
Proxy authentication settings: Basic Authentication Webmail: webmail.myserver.com 

By the way, is it possible to use my username and password directly in my aspx file? I mean, can anyone get this information?

+3
2

, - SMTP- , SSL..NET , ( ) EnableSsl.

+3

, SSL.NET, . , . ( - ), .

+1

All Articles