senzacionale
senzacionale

Reputation: 20906

changing name with email when sending emails

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 "[email protected]" 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' <[email protected]>" />

is not correct XML

Upvotes: 0

Views: 387

Answers (1)

Mario The Spoon
Mario The Spoon

Reputation: 4859

Use

message.From = new MailAddress("[email protected]", "Confirmation");

see

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

Upvotes: 4

Related Questions