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). | |
EndsWith(TSmtpSender.SMTP_HOST_DEFAULT)) | |
{ | |
TLogging.Log("for TestSendMail: need to configure SmptHost in the config file"); | |
return; | |
} | |
TSmtpSender.GetSmtpSettings = @TSmtpSender.GetSmtpSettingsFromAppSettings; | |
TSmtpSender sender = new TSmtpSender(); | |
if (!sender.SendEmail( | |
"no-reply@test.openpetra.org", | |
"OpenPetra Test", | |
"test.dummy@solidcharity.com", | |
"This is a test subject", | |
"Please ignore this e-mail!")) { | |
Console.WriteLine("problem"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment