The Legend of

Occasionally, you want a quick disposable email address for registering on suspicious websites, or in my case, for testing your own website’s registration system. While there are several options, I use Mailinator because you don’t need to set up anything first. You just enter whatever you want, followed by as your email address, and it just works.

This is what I was doing last week when I noticed that all the email sent by my website’s registration system was apparently from That’s definitely not what I set, and I confirmed that a valid from address was being used. The only recent change was that a friendly display name was now being included, instead of just the email address by itself. So what gives?

Upon examining the raw email (When viewing an email in Mailinator, click the Text View button), I noticed a linebreak in the From header.

MIME-Version: 1.0
From: "Quux Baz"

While that’s unusual, other email programs and systems handle it just fine. Mailinator, however, doesn’t like it one bit. It seems to regard it as invalid, and as such, replaces the field with as a sort of placeholder.

So what can you do about it? If you’re just registering on a website, don’t worry about it. If you’re working on your own website, see if you can change how the From email address is set.

In my case, I was using .NET’s SmtpClient, MailMessage and MailAddress classes. I found a StackOverflow question about the strange carriage return & line feed, which only appears when you set the DisplayName property of a MailAddress instance. This only happens under .NET 4.0, and you can see the hardcoded “\r\n ” are the end of the MailAddress.Encode(Int32) method. To resolve this, either convert the project to .NET 3.5, remove the display name, or, if you have an intermediate delivery system, add a processing step to fix this after it leaves the .NET SmtpClient.