Access Email Campaign SMTP Stteings

Posted by Community Admin on 03-Aug-2018 13:50

Access Email Campaign SMTP Stteings

All Replies

Posted by Community Admin on 26-Dec-2011 00:00

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.

Posted by Community Admin on 26-Dec-2011 00:00

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;

Posted by Community Admin on 28-Dec-2011 00:00

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

Posted by Community Admin on 12-Jan-2012 00:00

Thanks Tim and Svetosla.

This thread is closed