Mime |
public MimeMessage ParseMessage( CancellationToken cancellationToken = default )
| Exception | Condition |
|---|---|
| OperationCanceledException | The operation was canceled via the cancellation token. |
| FormatException | There was an error parsing the message. |
| IOException | An I/O error occurred. |
public static MimeMessage ParseMessage (string fileName) { // Load a MimeMessage from a file path or stream using (var stream = File.OpenRead (fileName)) { var parser = new MimeParser (stream, MimeFormat.Entity); return parser.ParseMessage (); } }