Access Email Campaign SMTP Stteings
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.
Waqar,
//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;
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();
Thanks Tim and Svetosla.