Email device parameters

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
Hi-Volt
Posts: 29
Joined: Mon Sep 12, 2011 4:52 am

Email device parameters

Post 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!

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Email device parameters

Post 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);
		}
    }
}
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Hi-Volt
Posts: 29
Joined: Mon Sep 12, 2011 4:52 am

Re: Email device parameters

Post by Hi-Volt »

Thank you very much!

MarcoL
Posts: 1
Joined: Mon Oct 20, 2014 1:34 am

Re: Email device parameters

Post 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!

Post Reply