Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to send mail , but i don't want to set my user name and password in web.config ? My be set some where else so i can assess securely. can you guide me on this ?
Hi,
You can set in the web.config file:
<system.net> <mailSettings> <smtp configSource="MailSettings.config"/> </mailSettings> </system.net>
And have all your login details in the external file:
<network host="relayServerHostname" port="portNumber" userName="username" password="password" />
Probably worth putting the MailSettings.config in the Config folder.
I removing user name and password from mail setting and use it directly in my code .
Then you would have to repeat login details each time.
Using a .config file make them global across all of your code.
Both work.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Can We send mail without setting username and password in web.config ?
I am trying to send mail , but i don't want to set my user name and password in web.config ? My be set some where else so i can assess securely. can you guide me on this ?
Hi,
You can set in the web.config file:
And have all your login details in the external file:
Probably worth putting the MailSettings.config in the Config folder.
I removing user name and password from mail setting and use it directly in my code .
Then you would have to repeat login details each time.
Using a .config file make them global across all of your code.
Both work.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.