简体   繁体   中英

I want to develop an automated email application in asp.net with c#

I am able to send an email on the press of a button using smtp in asp.net but in doing so, I am forced to enter the senders email address and password as strings in the code. Is there any way to do this securely without needing to send the credentials as plain text? I am new to this and hence my knowledge about encryption and other stuff's is bare minimal.

If you use (remote) authenticated SMTP, you need to authenticate with the server that will send the email. You could configure a mail server with non-authenticated SMTP on localhost (and only accept non-authenticated calls from localhost!). This way you don't need to enter credentials.

You could also use mail services like mailgun, where you can use a REST service to send email.

Credentials are hard to deal with. It is best to restrict the number of systems with access to credentials to the machines that you manage yourself (and have restricted access) or the machines (and their users) that you trust.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM