@ghircoiascamil
Please look this post Email - Setting parameters for mail account at runtime
It is was you are looking for. Have a good day.