SAML SSO C# LibrarySSO for Web, MVC, Core and Standard
Fully DocumentedLots of examples and code snippets
There are two type of mail message: MIME and Non-MIME. It's recommended to create mail messages in MIME format since most email clients today are MIME compatible. This section illustrates how to create mail messages.
In order to use the classes in the Ultimate Mail library, you have to add references to ComponentPro.Mail.dll, ComponentPro.Common.dll, and ComponentPro.Network.dll assemblies to your project.
The examples below show how to create a simple mail message using the UltimateMail component:
To encrypt a mail message, you only need an X509 certificate (private key is not required). Certificate can be loaded from a certificate file (.cer or .der extensions), from a PKCS#12 encrypted file (.pfx or .p12 extensions), or get it from the Window Certificate Store.
Only the message body is encrypted, the top-level headers are not encrypted.The example below shows how to encrypt a mail message.
A message can be both encrypted and signed. This ensures to the sender that only the intended recipients are able to read the message content, and to the recipient that the message was indeed sent by the sender.
There are two ways to produce a message that is both encrypted and sign:
In the first case, no one but the recipient will be able to validate the signature and access the message content. In the second case, no one but the recipient will be able to access the message content, but anyone will be able to validate the signature. Both ways have their pros and cons, but there is a very strong reason to prefer the first way: Outlook Express does not handle the second way correctly, and reports the correct signature is not valid.
The code snippet below shows you how to create an e-mail message and add an image from local disk as a LinkedResource object:
It is often needed to make sure recipients received your email. This task can easily be done by adding addresses that will receive the notification to your message using the Headers property of the MailMessage class.
To reply to a message, you can simply create a new message object including the subject of the original message with 'RE: ' placed at the beginning. The following code example shows you how to do that.
To include the original message as an attachment, simply create a new Attachment object containing the original message and add it to a new message. The following code example shows you how to do that.
Ultimate Mail lets you load and save mail messages easily.
With UltimateMail component, you can quickly create a new message from many sources such as from local disk file or data stream. The following sample illustrates how to create load an existing message (.EML). From version 5.0, Ultimate Mail can also load Outlook MSG file format.
MailMessage class provides a set of convenient methods for saving a message to either a local file or write it into a data stream. The following example shows you how to create a new mail message and save it to a local file:
Attachments in a mail message can either be extracted to file or stream object. The example below shows how to load a mail message and save its attachments to disk:
Linked resources in a mail message can either be extracted to file or stream object. The example below shows how to load a mail message and save its embedded resources to disk:
To encrypt a mail message, you need to provide a key or certificate for the encryption and call the Encrypt method of the MailMessage. See the example below for more details:
The following example demonstrates how to generate SAML Metadata for ADFS:
This section covers some advanced features of the Ultimate SAML component.
You can configure Ultimate SAML to write trace log to file, console, or any output. The information in the log file can assist with tracking down SAML issues. To enable SAML trace log in your application, add the following code segment to your application's bootstrap, usually in Application_Start event.