which is the best place (and how) to configure webmail (smtp server, ...)? I see a new App_Start folder and if I have understand correctly is the one that should be use for this stuff .. but I don't know where and how ..
Idea behind App_Start folder if just to have a clean Application_Start method of Global.asax.
If nuget package installs/uninstalls any pacakge which require code to be placed in Application_Start method of Global.asax, instead code can be added to App_Start folder and have a clean Global.asax
ByDefault in a new project you will have routers, bundling classess which in previous versions used to be in Global.asax.
Coming on to your Webmail configuration, I will suggest to have these setting in Web.config and access them through class available in App_Start folder if you want to have then accessible during your entire project or access them in the class whenever you
are sending the mail.
It all depends on your mail function usage.
Regards
Ankit
(Please select 'Mark as Answer' if my response has helped you.)
Marked as answer by Nerlaleph on Jan 18, 2013 11:58 AM
which is the best place (and how) to configure webmail (smtp server, ...)?
You don't configure SMTP Server in MVC Application, all you need is SmtpClient in your application and this requires some details about SMTP Server to connect and send email.
Nerlaleph
Member
37 Points
89 Posts
WebMail configuration in MVC4
Jan 18, 2013 09:21 AM|LINK
Hi,
which is the best place (and how) to configure webmail (smtp server, ...)? I see a new App_Start folder and if I have understand correctly is the one that should be use for this stuff .. but I don't know where and how ..
Kind regards
goel.ankit
Contributor
2531 Points
513 Posts
Re: WebMail configuration in MVC4
Jan 18, 2013 10:17 AM|LINK
Idea behind App_Start folder if just to have a clean Application_Start method of Global.asax.
If nuget package installs/uninstalls any pacakge which require code to be placed in Application_Start method of Global.asax, instead code can be added to App_Start folder and have a clean Global.asax
ByDefault in a new project you will have routers, bundling classess which in previous versions used to be in Global.asax.
Coming on to your Webmail configuration, I will suggest to have these setting in Web.config and access them through class available in App_Start folder if you want to have then accessible during your entire project or access them in the class whenever you are sending the mail.
It all depends on your mail function usage.
Ankit
(Please select 'Mark as Answer' if my response has helped you.)
CPrakash82
All-Star
18722 Points
2900 Posts
Re: WebMail configuration in MVC4
Jan 18, 2013 11:40 AM|LINK
You don't configure SMTP Server in MVC Application, all you need is SmtpClient in your application and this requires some details about SMTP Server to connect and send email.