Version: 3.0.3.2
Securely send, receive, preview, edit, sign/verify, and encrypt/decrypt email messages in any .NET project. 
That all the data sent and received between the client and the server is visible in a Trace event?
The Trace event is a handy tool for debugging applications. It will fire whenever the component sends or receives data, and is perfect for adding logging capabilities to your application.
Code Sample:
private void myComponent_Trace(object sender, SegmentEventArgs e) 
{ 
    // Append data to a file
    System.IO.FileStream file = new System.IO.FileStream("c:\\Test\\log.txt", System.IO.FileMode.Append); 
    file.Write(e.Segment.Buffer, 0, e.Segment.Count); 
    file.Close(); 
}
Back to Top
That HTML mail messages can be easily created by passing an HTML page into a constructor of the MessageStream object?
HTML messages can be constructed both from HTML documents on disk, and HTML scripts in memory.
Code Sample:
// Create an Html message from an Html file
MessageStream msg = new MessageStream("c:\\Test\\myHtmlDoc.html");
Back to Top
That messages are represented by MessageStream objects that allow the contents of a message to be accessed through properties?
The MessageStream object has properties for commonly used headers such as Subject and Content-Type, as well as easy-to-use collections for attachments and other MIME parts.
Code Sample:
// Create a MessageStream object 
MessageStream msg = new MessageStream(); 

msg.To.Add(new MailAddress("you@test.com")); // Add a recipient
msg.From = new MailAddress("me@test.com"); // Specify the sender
msg.Subject = "Hi!  This is my test message"; // Specify the subject 

// Add text (MessageStream.Text also does this). 
msg.Parts.Simple.Add(new MessagePartStream("This is the text of my message"));

// Add an attachment 
msg.Parts.Attachments.Add(new MimeAttachmentStream("C:\\files\\graph.bmp"));
Back to Top
That messages can be stored or loaded to/from a file?
Messages on disk can be loaded and parsed by the MessageStream object. Messages created using the MessageStream can also be stored to disk as files.
Code Sample:
//Load the file into a MessageStream object
System.IO.FileStream file = new System.IO.FileStream("original.eml", System.IO.FileMode.Open);
MessageStream msg = new MessageStream(file);
file.Close();

//Modify the message
msg.Subject = "A new subject!";

//Store the modified message to disk
msg.Store("c:\\modified.eml");
Back to Top
That the mail components will work with the two primary security techniques used by secure mail servers?
The secure mail components support both Implicit security (the connection is established in secure mode), and Explicit security (the secure connection is established after the client and server have agreed to switch to secure mode).
Code Sample:
// The server supports implicit security
pop1.Security = Security.Implicit;

// The server supports explicit security
imap1.Security = Security.Explicit;
Back to Top
That the secure components can programmatically decide whether to accept a server certificate?
The secure components include a CertificateReceived event, which will fire when a certificate is received from a remote host. Code can be added to the event handler to programmatically determine whether a certificate should be accepted or not.
Code Sample:
private void myComponent_CertificateReceived(object sender, CertificateReceivedEventArgs e) 
{ 
    string msg = ""; 

    // Check to see if the certificate is from a trusted root. 
    if(!e.TrustedRoot) 
        msg += "This certificate is not from a trusted root\n"; 

    // Check to see if the certificate has a valid date. 
    if(!e.ValidDate) 
        msg += "This certificate does not have a valid date\n"; 

    // Check to see if the certificate has a valid name. 
    if(!e.ValidName) 
        msg += "This certificate does not have a valid name\n"; 

    if(msg != "") 
    { 
        msg += "Would you like to accept this certificate anyway?"; 
        if(MessageBox.Show(msg, "Invalid Cert Received", MessageBoxButtons.YesNo) == DialogResult.Yes) 
        { 
            // User wants to accept the invalid cert. Accept it. 
            e.Accept = true; 
        } 
    } 
}
Back to Top
That a component’s security can be enabled by setting a single property?
Simply setting the Security property allows the component to communicate with secure servers.
Code Sample:
// The component will be able to connect to an implicitly secure server
myComponent.Security = Security.Implicit;


Back to Top
That any Microsoft certificate store can be easily accessed?
The CertificateStore object makes for easy access and selection of certificates contained in Microsoft certificate stores.
Code Sample:
//Show all certificates in the CurrentUser/MY Store
CertificateStore store = new CertificateStore(CertificateStoreLocation.CurrentUser, CertificateStoreName.My);
foreach (Certificate certificate in store)
    Debug.WriteLine(certificate.IssuedTo + ": " + certificate.IssuerName);
Back to Top
That the certificate received from a server can be examined?
During the secure handshake, the Certificate Received event will fire, providing the user with information about the server’s certificate, as well as an opportunity to accept or reject the certificate, if desired.
Code Sample:
//The certificate received event will fire when the component receives the server's certificate
private void myObject1_CertificateReceived(object sender, CertificateReceivedEventArgs e) 
{ 
    //Examine who the certificate was issued to, and whether its date is valid
    if (e.Certificate.IssuedTo == "MyPrivateServer" && e.ValidDate == true)
        e.Accept = true;
    else
        e.Accept = false; 
}
Back to Top