Questions tagged [mailsettings]

14 questions
39
votes
8 answers

Setting multiple SMTP settings in web.config?

I am building an app that needs to dynamically/programatically know of and use different SMTP settings when sending email. I'm used to using the system.net/mailSettings approach, but as I understand it, that only allows one SMTP connection…
alphadogg
  • 12,762
  • 9
  • 54
  • 88
24
votes
2 answers

How can I setup a friendly email name in the MailSetting section of web.config?

Currently I have: How can I change it so the…
Eduardo Molteni
  • 38,786
  • 23
  • 141
  • 206
18
votes
2 answers

SMTP Authentication with config file's MailSettings

I'm storing my MailSettings in a web.config, however when I send the message, my SMTP server reports back that I need to use authentication. I've got my username/password in the config file, but it still fails. It works if I do the following, but it…
Eric
  • 1,882
  • 3
  • 16
  • 21
9
votes
2 answers

SMTP Mail client settings in app.config file C#

I've put mail settings in app.config and can successfully pull them into a mailSettingsSectionGroup object. However, I'm not sure how to send a message using these settings. This is what I have so far: System.Configuration.Configuration config = …
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
4
votes
1 answer

Why there is "from" attribute of element in ? How can i use it?

Why there is "from" attribute of element in ? How can i use it? As far as i see, i anyway have to specify From parameter for MailMessage class constructor. Can i use "from" attribute of element for this in any…
Konstantin
  • 51
  • 2
3
votes
3 answers

Trying to access App.config file for mail settings but fails to work

Hello we have a Business Logic Layer which has an Email Services Class. In this class we have a method which will create an email(This part works and compiles fine). However when we try to access the app config file in order to test the method we…
mw.
  • 43
  • 1
  • 5
2
votes
1 answer

Saving to mailSettings in App.Config in .net wf application

I'm trying to save from a windows form to the following settings in app.config
Nim
  • 356
  • 3
  • 17
1
vote
0 answers

Use both send and pickup directory method for SMTP mailSetting

Current system that I working on has a email sending function with this configuration in Web.config as below
Dean
  • 668
  • 12
  • 32
0
votes
2 answers

Can I have two mail server for different emails

I have a registered domain name where the emails are handled by windows live admin center having a single mx record for my domain. I also have access to modify the dns records any time. We have around 20 email registered in windows live for my…
Sameer
0
votes
0 answers

How to Set TLS 1.2 in web.config in asp.net webform

I am not sure if there is a way to add TLS 1.2 or TLS 1.1 in ` in web.config file. In code i can add it as System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; I am…
Learning
  • 19,469
  • 39
  • 180
  • 373
0
votes
2 answers

Send mail using different from address

i already have a mail service, but i need to use different from address, because this service is used by many services. Now, i have this code, which works fine: public static bool SendMail(Mail mail) { var smtp = new SmtpClient(); var…
Mati Silver
  • 185
  • 1
  • 13
0
votes
1 answer

Add config file MailSettings to PropertyGrid

I'm busy building a quick little WinForms app that allows editing of a provided app.config file. I created a wrapper around the System.Configuration.Configuration class, exposing only the properties I want changed. I've done AppSettings and…
Balah
  • 2,530
  • 2
  • 16
  • 24
0
votes
2 answers

Authenticated mail sending not working in .NET

I have a script sending mail from my .net application. My hosting provider requires the emails to be authenticated if I don't want to cause delays in receiving them (currently delay is almost a day from sending). I have build mail sending script…
nickornotto
  • 1,946
  • 4
  • 36
  • 68
0
votes
1 answer

smtp mailSettings from

Is it possible to use the "from" in the config file as the MailMessage.From when creating an email in .net. Having trouble accessing it. Whenever I try referring ConfigurationManager I get a does not exist error but I am referencing them, see…
Jt2ouan
  • 1,964
  • 9
  • 33
  • 55