Samuel
Samuel

Reputation: 2019

MailKit returns empty From on a fetch

I was testing MailKit with Fetch on the mail Envelope. summary.Envelope.From[0] gave an exception after getting emails from the mail server. On inspection, the From field is shown on the original mail file as:

... ... From: Root User <> ...

Gmail shows this mail as (unknown sender)

I can attach the header if necessary. Is there a standard way to deal with this?

Upvotes: 1

Views: 136

Answers (1)

jstedfast
jstedfast

Reputation: 38528

Yes, you can do what GMail does which is effectively:

if (summary.Envelope.From.Count == 0)
    return "(unknown sender)";

Upvotes: 1

Related Questions