3

Closed

"From" header in contact e-mail uses author's name but blog's e-mail address

description

If a user uses the contact form to send an e-mail to the blog owner, the mail's "from" header contains the user's name but the blog's e-mail address. If you want to add that contact to the address of your mail client it will save a wrong combination of name and e-mail address.

I highly suggest to simplify the mail headers. I contact.aspx.cs instead of:
mail.From = new MailAddress(BlogSettings.Instance.Email, name);
mail.ReplyTo = new MailAddress(email, name);
mail.Sender = mail.ReplyTo;

simply use:
mail.From = new MailAddress(email, name);

It's straight forwared and works as expected.
Closed Oct 11, 2008 at 2:55 PM by
It use to work like that, but a lot of problems occurred on websites that can't relay e-mails from other domains. It's actually quite common for web hosters to disable that. Instead we use the ReplyTo header which gives you the same result

comments