In a scenario, I need to send emails to the users. But the problem is that I dont want to hardcode or configure my password and username for email. If anyone aware of PHP MAILER, it does support this facility where one does not need to give his own username and password for sending emails. And these emals can be directly send through localhosts. But this wont work with c#
The question is can we do same in c#? If yes then how? because I have searched almost everywhere but count find anything except that we need to find the SMTP client which can send mail without verifying the credentials.
You always can save username and password encrypted in the config.file.
Use this command to encrypt any section from the config %windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -pef "connectionStrings" C:\documents and settings\bob\projects\myproject
Be aware, that the encryption is MACHINE-Specific. So you must do that on the target machine
More details on MSDN: http://msdn.microsoft.com/en-us/library/dtkwfdky(v=vs.100).aspx