kcwallace Posted March 21, 2007 Posted March 21, 2007 I copied the following code out of MSDN. I am trying to make the Alternate View email method work, but am having some difficulty. I receive a "{"Illegal characters in path."}" error. ANy suggestions? // Construct the alternate body as HTML. string body = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; body += "<HTML><HEAD><META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\">"; body += "</HEAD><BODY><DIV><FONT face=Arial color=#ff0000 size=2>this is some HTML text"; body += "</FONT></DIV></BODY></HTML>"; // Add the alternate body to the message. AlternateView alternate = new AlternateView(body, MediaTypeNames.Text.Html);//error here message.AlternateViews.Add(alternate); Quote Go Beavs!!!
kcwallace Posted March 21, 2007 Author Posted March 21, 2007 Nevermind, I got it to work. string body = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; body += "<HTML><HEAD><META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\">"; body += "</HEAD><BODY><DIV><FONT face=Arial color=#ff0000 size=2>this is some HTML text"; body += "</FONT></DIV></BODY></HTML>"; AlternateView alternate = AlternateView.CreateAlternateViewFromString(body,null,"text/html"); message.AlternateViews.Add(alternate); Quote Go Beavs!!!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.