Page 1 of 1

Email device parameters

Posted: Tue Aug 07, 2012 4:53 am
by Hi-Volt
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!

Re: Email device parameters

Posted: Tue Aug 07, 2012 8:14 am
by mark.monroe
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);
		}
    }
}

Re: Email device parameters

Posted: Fri Aug 10, 2012 1:20 am
by Hi-Volt
Thank you very much!

Re: Email device parameters

Posted: Mon Oct 20, 2014 2:56 am
by MarcoL
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!