login about faq

Tried to find the answer to this in the documentation / examples, but haven't found it.

In the configuration file of an application or website you can set the default mailsettings: <system.net> <mailsettings> <smtp> <network host="xxx" port="25" username="xxx" password="xxx"/> </smtp> </mailsettings> </system.net>

Is it possible to let MailMan use these settings by default or do you need always need to define the host/port/username/password after creating the MailMan object?

asked May 24 '13 at 08:23

Andre's gravatar image

Andre
16112


Any reply for this question?

link

answered Sep 05 '13 at 11:37

jsherwood's gravatar image

jsherwood
11

It is extremely simple to write a few lines of code that loads the XML and uses the values found within to set the Chilkat MailMan properties. I would not make sense for Chilkat to include this in the API, because Chilkat supports many different programming languages and operating systems and app.config and web.config make no sense except for in certain environments.

Here is some sample C# code:

            bool success = xml.LoadXmlFile("c:/aaworkarea/config.xml");

        string host = xml.ChilkatPath("mailsettings|smtp|network|(host)");
        string username = xml.ChilkatPath("mailsettings|smtp|network|(username)");
        string password = xml.ChilkatPath("mailsettings|smtp|network|(password)");
        int port = Convert.ToInt32(xml.ChilkatPath("mailsettings|smtp|network|(port)"));

        // Alternatively:
        Chilkat.Xml network = xml.FindChild("mailsettings").FindChild("smtp").FindChild("network");
        string host2 = network.GetAttrValue("host");
        string username2 = network.GetAttrValue("username");
        // etc..
link

answered Sep 09 '13 at 12:05

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×80
×47
×1

Asked: May 24 '13 at 08:23

Seen: 1,392 times

Last updated: Sep 09 '13 at 12:05

powered by OSQA