ASP.NET Email From Name (non-email address)

M

magister

Hi I am sending emails from my website. The from field usually is an
email address, but alot of email readers also seem to be able to
pickup a "from real name". I read somewhere that I can set this by
putting the name followed by the actual email address in
parathesis....like this...

MailMessage msgMail = new MailMessage();
msgMail.To = EmailAddress.Text;
msgMail.From = "funny email Website" + "([email protected])";
msgMail.Subject = "Your Document";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = " ";
SmtpMail.SmtpServer = "127.0.0.1";
SmtpMail.Send(msgMail);

However this doesn't seem to work for me. I am sending to an email
address in the same domain....I just get from "Website"

Any ideas, I seem to remember that CDONTS had support for a FromName,
why don't we have this in .net????
 
I

ilPostino

The format is : Display Name <email address>

so msgMail.From = "Some Name <someemail>";

Craig
 
M

magister

I did try

msgMail.From = "Some Name <someemail>";

&

msgMail.From = "Some Name (someemail)";

no go, would the mx settings in microsoft exchange
override these coded setting??

Thanks,
Matt
 
K

Klaus H. Probst

The Exchange SMTP service can be configured to block outgoing email from
addresses it does not recognize, but I've never encountered this.

The canonical format is 'John Doe <[email protected]>'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top