using System;
using Dimac.JMail;
namespace JMailTest
{
class MainClass
{
[STAThread]
static void Main( string[] args )
{
Message message = new Message();
message.From.Email = "me@mydomain.com";
message.To.Add( "myfriend@hisdomain.com" );
message.Subject = "Hello, world!";
message.BodyText = "Hello, world! My hovercraft is full of eels.";
message.Attachments.Add( "C:\\me_dancing.wmv" );
try
{
Smtp.Send( message, "mail.mydomain.com" );
Console.WriteLine( "The message has been sent." );
}
catch ( Exception ex )
{
Console.WriteLine( "Failed to send message: {0}", ex.Message );
}
}
}
}