1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Access Email Campaign SMTP Stteings

Access Email Campaign SMTP Stteings

4 posts, 0 answered
  1. waqar
    waqar avatar
    76 posts
    Registered:
    28 Mar 2011
    26 Dec 2011
    Link to this post
    Hi,
    Can anyone please let me know how can I access SMTP setting of email campaigns via API.
    SMTP setting image is attached.

    Thanks in advance.
  2. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    26 Dec 2011
    Link to this post
    Waqar,

    Here's a short example to get you on the right track

    //using Telerik.Sitefinity.Configuration;
    //using Telerik.Sitefinity.Modules.Newsletters.Configuration;
     
    var smtpConfig = Config.Get<NewslettersConfig>();
     
    string smtpHost = smtpConfig.SmtpHost;
    int smtpPort = smtpConfig.SmtpPort;
    bool useSmtpAuth = smtpConfig.UseSmtpAuthentication;
    string smptUser = smtpConfig.SmtpUsername;
    string smtpPass = smtpConfig.SmtpPassword;
    bool useSSL = smtpConfig.UseSmtpSSL;

  3. Svetoslav Petsov
    Svetoslav Petsov avatar
    456 posts
    Registered:
    24 Sep 2012
    28 Dec 2011
    Link to this post
    Hi,

     Tim is correct about getting the values. Here's how you can set them:

    var manager = ConfigManager.GetManager();
                var newslettersConfigSection = manager.GetSection<NewslettersConfig>();
                newslettersConfigSection.SmtpHost = "test";
                newslettersConfigSection.UseSmtpAuthentication = true;
                     //and so on for the other properties
                manager.SaveChanges();

    Greetings,
    Svetoslav Petsov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. waqar
    waqar avatar
    76 posts
    Registered:
    28 Mar 2011
    12 Jan 2012
    Link to this post
    Thanks Tim and Svetosla.
4 posts, 0 answered