I believe what you want is actually the View Source
command, not the View Code
one. This is available by default under Message -> Move -> Actions -> Other Actions -> View Source
.
isBodyHtml is true and AlternateViews set, still no View Code option in Outlook 2010 using c#
-
02-07-2022 - |
Frage
I have both .isBodyHtml=true
and AlternativeViews
option with one for text/html
, but the View Code
option in Outlook is still grayed out and not available for me to use.
My code:
var emailContent = "<html><body><b>this should be bold</b></body></html>";
var client = new SmtpClient("...", 25)
{
Credentials = new NetworkCredential("...", "..."),
EnableSsl = true
};
var msg = new MailMessage("...", toEmail, "subject", emailContent);
msg.AlternateViews.Add(AlternateView.CreateAlternateViewFromString(emailContent, new System.Net.Mime.ContentType("text/html")));
msg.IsBodyHtml = true;
client.Send(msg);
Note: I am using GMail's smtp, so I wonder if GMail is doing something to the headers saying, "hey, no one should be able to View Source in Outlook for gmail emails"? Thanks!
Edit: screenshot of grayed out View Code button in Outlook 2010:
Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow