Last post Dec 21, 2017 05:15 PM by 0belix
Dec 21, 2017 04:19 PM|0belix|LINK
I'm wondering if there is a way to configure multiple SMTP settings on the web.config, much like as in the ConnectionStrings, where you can have an ID for each, and then use them accordingly to your needs?
If this is not possible, am i left to change the SMTP settings via code-behind?
Dec 21, 2017 04:57 PM|PatriceSc|LINK
Depends on the exact need. You could :
- or take settings from some other source
- or maybe use a web.config transformation (you can change the web.config automatically depending on where you publish your app)
Dec 21, 2017 05:15 PM|0belix|LINK
Hi Patrice, thx for the answer!
I had just found that same stackoverflow page and was considering implementing its solution. The exact need is that there are multiple actions on my app that fire emails to the users confirming actions and/or informing others of specific actions by the current
user. This sometimes causes too much payload on the SMTP account which is limited to a certain amount of usage per day. Due to this, i'm setting up multiple SMTP accounts and cycle their usage, so that one fires an email, then the next email is fired by the
next and so on.
This solution will probably suit my needs, i just need to store a value on the database that stores the index of the last used STMP account, so that i retrieve it, use the next and update the database value.