Hi. I have written a code to modify the Email device parameters (SMTP, port, etc) via script, but all the settings are lost during the power cycle. Could you suggest me in which way it is possible to save the settings permanently?
Thank you!
Email device parameters
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: Email device parameters
The below code will save the updates to the xml file.
Code: Select all
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
using Neo.ApplicationFramework.Common.Service;
using Neo.ApplicationFramework.Common;
public partial class Screen1
{
void Button1_Click(System.Object sender, System.EventArgs e)
{
IDeviceManagerServiceCF deviceManagerService = ServiceContainerCF.GetServiceSafe<IDeviceManagerServiceCF>();
IEmailDevice m_EmailDevice = deviceManagerService.GetOutputDevice<IEmailDevice>();
m_EmailDevice.FromEmailAddress = "From Script@what.com";
deviceManagerService.SaveDevices(m_EmailDevice as IOutputDevice);
}
}
}
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Re: Email device parameters
Thank you very much!
Re: Email device parameters
I have also written a code to modify the Email device parameters via script. But I cannot set m_EmailDevice.AuthMode (string, int, bool do not work). Can you show me how to do it?
Thank you in advance!
Thank you in advance!