cannot change font or color of text RRS feed

  • Question

  • cannot change font or color of text in writing email in windows 8.1. Tried changing to HTML in MSN "help" but there is no response
    Monday, September 24, 2018 3:30 AM

All replies

  • Hi cheme1,

    Thank you for posting here. 

    If you want to send mail with font and color, you could try the code below.'

    using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Mail; using System.Text; using System.Threading.Tasks; namespace ConsoleApp { class Send_mail { static void Main(string[] args) { string smtpAddress = "smtp.live.com"; int portNumber = 587; bool enableSSL = true; string emailFrom = "xxxx@hotmail.com"; string password = "xxxxxx"; string emailTo = "xxxxx@xxx.com";

    string s = "Hello"; string subject = s; string message1 = "something"; string message2 = "<font face='Arial Black' color='red'>something</font>";//"this is first line.<br><b>bold</b>" string message = "My message is " + message1 + " and " + message2; string body = message;//"Hello, I'm just writing this to say Hi!"; using (MailMessage mail = new MailMessage()) { mail.From = new MailAddress(emailFrom); mail.To.Add(emailTo); mail.Subject = subject; mail.Body = body; mail.IsBodyHtml = true; // Can set to false, if you are sending pure text. //mail.Attachments.Add(new Attachment("C:\\SomeFile.txt")); //mail.Attachments.Add(new Attachment("C:\\SomeZip.zip")); using (SmtpClient smtp = new SmtpClient(smtpAddress, portNumber)) { smtp.Credentials = new NetworkCredential(emailFrom, password); smtp.EnableSsl = enableSSL; smtp.Send(mail); } } } } }

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, September 25, 2018 8:09 AM
  • Are you actually talking about sending an email in code? (This is a programming code forum).

    Or are you talking about just using an email client? (In which case, you're in the wrong place).

    Tuesday, September 25, 2018 8:13 AM