hkjhj
hkjhj

Reputation: 195

Encrypt mailSettings in Web.config

i want to ask about to encrypt mailSettings section under system.net

enter image description here

but, when i try to encrypt by cmd.exe it seems that they cannot find mailSettings

enter image description here

i use this script

"aspnet_regiis.exe -pef "mailSettings" "D:\website" -prov ConnectionTestProvider"

can someone help me to encrypt this part?

Upvotes: 3

Views: 2394

Answers (2)

Tommaso
Tommaso

Reputation: 351

CMD -> run as administrator

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319

---FOR CONNECTIONSTRINGS---

ASPNET_REGIIS -pef "connectionStrings" "C:\Inetpub\wwwroot\namefoldersite" -> CRIPT
ASPNET_REGIIS -pdf "connectionStrings" "C:\Inetpub\wwwroot\namefoldersite" -> DECRIPT


---FOR MAILSETTING---

ASPNET_REGIIS -pef "system.net/mailSettings/smtp" "C:\Inetpub\wwwroot\namefoldersite" -> CRIPT
ASPNET_REGIIS -pdf "system.net/mailSettings/smtp" "C:\Inetpub\wwwroot\namefoldersite" -> DECRIPT

Upvotes: 4

hkjhj
hkjhj

Reputation: 195

I've found the solution. you need to specify path for mailSettings for this one

"aspnet_regiis.exe -pef "system.net/mailSettings/smtp" "D:\website" -prov ConnectionTestProvider"

enter image description here

after try and find solution for days.

Upvotes: 13

Related Questions