for html, the background color is set in the corresponding tag. That is:
<body bgcolor="#fff">
text
</body>
the #fff can be changed out, obviously, to any color that html will recognize (i.e. 6 digit hex web colors)
Oh, and it doesn't have to be in the <body> tag necessarily, either. (e.g., could be the <head> tag)
You can write html code in mail.body:
//create the mail message MailMessage mail =new MailMessage();//set the addresses mail.From =new MailAddress("me@.mycompany.com"); mail.To.Add("you@.yourcompany.com");//set the content mail.Subject ="This is an email"; mail.Body ="<body bgcolor="#fff">text</body>"; mail.IsBodyHtml =true;//send the message SmtpClient smtp =new SmtpClient("127.0.0.1"); smtp.Send(mail);
No comments:
Post a Comment