0
MailMessage message = new MailMessage(email.From,
                                                      email.To,
                                                      email.Subject,
                                                      email.Body);

but i can not see name when i get email. I want that instead of "noreplay@domain.com" i will get name like "Confirmation" or something else. Can i change email with name in from field in web.config?

<add key="ActivationUserFromEmail" value="'Confirmation' <noreplay@domain.com>" />

is not correct XML

senzacionale
  • 20,448
  • 67
  • 204
  • 316

1 Answers1

4

Use

message.From = new MailAddress("noreplay@domain.com", "Confirmation");

see

http://msdn.microsoft.com/en-us/library/1s17zfkf.aspx

Mario The Spoon
  • 4,799
  • 1
  • 24
  • 36
  • To answer my own question: http://stackoverflow.com/questions/2668721/mailmessage-difference-between-sender-and-from-properties – Mario The Spoon Oct 12 '10 at 08:49