Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1289
  • Last Modified:

ASP.NET Send SMTP E-mail - No password in Web.Config

I'm using ASP.NET 2.0, VB code to send an e-mail to several addresses.  The e-mail is coming from whatever e-mail address the online user specifies in the txtEmail texbox.  Its goes to one of 3 e-mail addresses based on a radio button choice.  I'm using System.Net.Mail, but it wants the SMTP relay server info in the web.config file like:

<system.net>
    <mailSettings>
      <smtp>
        <network
             host="relayServerHostname"
             port="25"
             userName="username"
             password="password" />
      </smtp>
    </mailSettings>
  </system.net>

I don't want all this information to be online in the web.config file.  If someone gets into the system, they have access to it.  Specifically how can I do this so I don't a user/password to send e-mail?  Please help.
0
redmission
Asked:
redmission
  • 4
  • 2
1 Solution
 
David RobitailleAnalyst ProgrammerCommented:
0
 
redmissionAuthor Commented:
That works, but is there any way I can make this anonymous so there is no need to even have the username, password?
0
 
David RobitailleAnalyst ProgrammerCommented:
yes, but it up to the SMTP server settings.
As an exemple, my SMTP server dont ask a for user/password for id adress in the local network.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
David RobitailleAnalyst ProgrammerCommented:
id adress = ip adress
0
 
David RobitailleAnalyst ProgrammerCommented:
did that answer your question?
0
 
redmissionAuthor Commented:
Thanks!  We also used 127.0.0.1 as the name of the database server to help make things more secure.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now