Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Test sending Mail with Ict.Common.IO and MimeKit
// mcs testSendMail.cs -r:System.Data -r:delivery/bin/Ict.Common.IO.dll -r:delivery/bin/Ict.Common.dll -r:delivery/bin/MimeKit.dll
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
using System.Dynamic;
using System.Globalization;
using System.Xml;
using System.Text;
using System.IO;
using System.Data;
using MimeKit;
using Ict.Common;
using Ict.Common.IO;
public class MainClass
static public void Main()
new TLogging("../../log/test.log");
new TAppSettingsManager("/home/op_dev/etc/PetraServerConsole.config");
TLogging.DebugLevel = TAppSettingsManager.GetInt16("Client.DebugLevel", 0);
if (TAppSettingsManager.GetValue("SmtpHost", TSmtpSender.SMTP_HOST_DEFAULT).
TLogging.Log("for TestSendMail: need to configure SmptHost in the config file");
TSmtpSender.GetSmtpSettings = @TSmtpSender.GetSmtpSettingsFromAppSettings;
TSmtpSender sender = new TSmtpSender();
if (!sender.SendEmail(
"OpenPetra Test",
"This is a test subject",
"Please ignore this e-mail!")) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment