I’m using code like this to send email:
var smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587, //465?
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
};
using (var message = new MailMessage(fromAddress, toAddress)
{
Subject = subject,
Body = body
})
{
smtp.Send(message);
}
…and it works just dandy. Now, though, I want to be able to control the size and style of the font used (e.g., Western 12).
UPDATE
Although I would still like to use a nicer looking font (such as Western), my main problem was having what I call the “box” characters in the body text (that square character). I found that the following rectified that dilemma:
body = body.Replace("�", "");
(although in Notepad and in the VS Editor it doesn’t look like a box, but like a marooned question mark or some such) – in fact, it looks like that here, too, in the formatted version of my question. In the question editor (terminology?) it looks like the square/box.
Try:
You’ll get the idea.