Sha256: 92c4caa5c9028d55d624328259a0828489468fc8ddb03a218bb6dbcef39feb54

Contents?: true

Size: 873 Bytes

Versions: 3

Compression:

Stored size: 873 Bytes

Contents

using System;

using NLog;
using NLog.Targets;

class Example
{
    static void Main(string[] args)
    {
        try
        {
            Console.WriteLine("Setting up the target...");
            MailTarget target = new MailTarget();

            target.SmtpServer = "192.168.0.15";
            target.From = "jaak@jkowalski.net";
            target.To = "jaak@jkowalski.net";
            target.Subject = "sample subject";

            NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);

            Console.WriteLine("Sending...");
            Logger logger = LogManager.GetLogger("Example");
            Console.WriteLine("Sent.");
            logger.Debug("log message");
        }
        catch (Exception ex)
        {
            Console.WriteLine("EX: {0}", ex);
                
        }
    }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nlog-1.0.0.505.20100822 docs/examples/targets/Configuration API/Mail/Simple/Example.cs
nlog-1.0.0.505 docs/examples/targets/Configuration API/Mail/Simple/Example.cs
nlog-1.0.0.505-mswin32 docs/examples/targets/Configuration API/Mail/Simple/Example.cs