Results 1 to 3 of 3

Thread: Allow email sending, but encrypt settings

  1. #1

    Thread Starter
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Allow email sending, but encrypt settings

    Gents,
    I'm wanting to allow "Email notifications" from my application, where by the user would supply their gmail username, password and a "to" address to send the notifications to. I am storing these as application settings, but obviously they'll be unencrypted in the config file.

    What's the best way to do this?

    I thought about just requiring them to type in their password each time they run the application, that way nothing is stored, but this isn't user-friendly. Is there a different way to send email from the application, much like other apps do where there's a "submit a problem" type functionality?

    Thanks.

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Allow email sending, but encrypt settings

    Quote Originally Posted by stateofidleness View Post
    Gents,
    I'm wanting to allow "Email notifications" from my application, where by the user would supply their gmail username, password and a "to" address to send the notifications to. I am storing these as application settings, but obviously they'll be unencrypted in the config file.

    What's the best way to do this?

    I thought about just requiring them to type in their password each time they run the application, that way nothing is stored, but this isn't user-friendly. Is there a different way to send email from the application, much like other apps do where there's a "submit a problem" type functionality?

    Thanks.
    JMC has a codebank entry I think, about encrypting the configuration file and using that. You could probably check that out. His example is for database credentials, I think. But, credentials are credentials :P
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Allow email sending, but encrypt settings

    As WD says. Follow the CodeBank link in my signature and check out my Protected Configuration thread.

    That said, there are a couple of things to consider. My code edits the primary config file, which means that the current user must have write access to the Program Files folder. If you're using My.Settings, the default values will be stored in the primary config file but the current values will be stored in the user config file. I haven't ever tested whether encrypting a section in the primary config file will propagate to the user config file.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width