Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dipa 88 posts 370 karma points
    Mar 04, 2016 @ 09:00
    Dipa
    0

    Change web.confib settings environment wise

    Hello,

    I want save my email credentials to the web.config but not statically. It should be configurable. I want it because in development environment and production environment I have different credentials.

    I want to send email using this credentials. Is there any way to change web.config settings from umbraco?

    Please help me for it.

    Thanks.

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Mar 04, 2016 @ 09:21
    Alex Skrypnyk
    0

    Hi Dipa,

    Great package for your issue is T4Utilities

    Read article https://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited

    Thanks, Alex

  • M T 35 posts 212 karma points
    Mar 04, 2016 @ 09:58
    M T
    0

    Hi Dipa,

    I don't think it's wise to be editing a web.config from your CMS as this could be a big security flaw, it depends on what you have in your config but I even encrypt mine because of sensitive info like users and passwords, what you need is XML transforms, this enables you to have a config for each environment and settings in there will override you main web.config depending on what environment you're in.

    https://msdn.microsoft.com/library/dd465318(v=vs.100).aspx

    if you're using UaaS refer to this :-

    https://our.umbraco.org/documentation/Umbraco-as-a-Service/Set-Up/Config-Transforms/

    However technically this is still static, you just have multiple static configs that override eachother, you cant pull data from you DB and put it into the same config file that is configuring your DB connection. I think this is your best solution.

    Regards M

Please Sign in or register to post replies

Write your reply to:

Draft