asp.net mvc smtp few accounts
I need to use 2 mail accounts (for user1 and user2)
<system.net>
<mailSettings>
<smtp from="user1">
<network host="smtp.yandex.ru" port="25" userName="user1" password="pass" />
</smtp>
</mailSetti开发者_JAVA百科ngs>
</system.net>
Check this answer : Setting multiple SMTP settings in web.config?
There is way to add two smtp account in web.config file :
but to set perticular account you have to choose one of the following way :
Add the smtp data in the appsetting and than parse it and read it
or
Read the web.config file and then parse the node and then set the SMTP client configuration manually.
精彩评论