Author
|
Message
|
Nevron Support
|
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
That's great. You can also remove the <style> element from the <head> element of the document. It shouldn't be necessary anymore.
Best Regards, Nevron Support Team
|
|
|
Tom Galczynski
|
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 29,
Visits: 87
|
Bingo! That seems to have done it. Here is the html from the control: <!DOCTYPE html><html> <head> <meta charset="utf-8" /> </head> <body style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"> <section style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"> <p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"> <span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">First line.</span> </p> <p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"> <span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">Second line.</span> </p> </section> </body></html>
And here is "view source" from Outlook: <!DOCTYPE html><html><head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"><section style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"><p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"><span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">First line.</span></p><p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"><span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">Second line.</span></p></section></body></html>
Also looks fine in Gmail and Thunderbird. Thanks very much! :-)
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Tom. Here's one more idea for you to try: please remove all new lines from the HTML code generated by the NOV Rich Text View before sending the email. Thus the HTML will be on a single line and Outlook should not add all these <br> elements. You can use the following line of code to remove the new lines from the HTML string: htmlCode = htmlCode.Replace(Environment.NewLine, String.Empty); Please try this and let us know if it fixed the issue with Outlook.
Best Regards, Nevron Support Team
|
|
|
Tom Galczynski
|
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 29,
Visits: 87
|
I really appreciate you guys looking into this. Thanks! Unfortunately this did not change the appearance. Outlook (and Gmail) show blank lines before the body text. Thunderbird does not. Here is the output from the control:
<!DOCTYPE html> <html> <head><style> br { display: none; font-size: 0; max-height: 0; line-height: 0; mso-hide: all;} </style> <meta charset="utf-8" /> </head> <body style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"> <section style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"> <p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"> <span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">This is the first line of the body of the email.</span> </p> </section> </body> </html>
And here is the "view source" from Outlook: <!DOCTYPE html><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br><html><br><head><style> br { display: none; font-size: 0; max-height: 0; line-height: 0; mso-hide: all;} </style><br><br></head><br><body style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"><br><section style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"><br><p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"><br><span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">This is the first line of the body of the email.</span><br></p><br></section><br></body><br></html><br>
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hello, We did some additional research and it appears that Outlook has only partial support for the CSS "display" property. Please try the following CSS and let us know if it fixes the Outlook issues: br { display: none; font-size: 0; max-height: 0; line-height: 0; mso-hide: all; }
Best Regards, Nevron Support Team
|
|
|
Tom Galczynski
|
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 29,
Visits: 87
|
Hi there. Tried your suggestion and the Outlook issue persists. :-( Here is the output from the control:
<!DOCTYPE html> <html> <head><style> br { display: none; } </style> <meta charset="utf-8" /> </head> <body style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"> <section style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"> <p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"> <span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">This is the body text.</span> </p> </section> </body> </html>
Here is the source from Outlook: <!DOCTYPE html><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><br><html><br><head><style> br { display: none; } </style><br><br></head><br><body style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"><br><section style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;margin:0;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;"><br><p style="text-align:left;direction:ltr;vertical-align:top;color:#000000;visibility:visible;border-collapse:separate;border-spacing:0 0;border:none;font:normal normal 10pt/1 'Arial',sans-serif;text-decoration:none;padding:0;clear:none;float:none;text-indent:0;page-break-before:auto;page-break-after:auto;position:static;margin:8px 0;"><br><span style="color:#000000;visibility:visible;border:none;text-decoration:none;font:normal normal 10pt/normal 'Arial',sans-serif;">This is the body text.</span><br></p><br></section><br></body><br></html><br>
Thanks for your help and Happy New Year :-)
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Tom and Happy New Year 2020! Outlook uses the Microsoft Word HTML engine. It's far from perfect and does not support all CSS properties, so maybe that's why you get an incorrect rendering in Outlook. Please try using only the first CSS declaration: br { display: none; }
Best Regards, Nevron Support Team
|
|
|
Tom Galczynski
|
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 29,
Visits: 87
|
In both Gmail and Outlook the blanks persist. In Thunderbird though, that took care of it. I've attached the source from Outlook in emailblankssource.txt. Thanks for your help.
|
|
|
Nevron Support
|
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hello, Thank you for the HTML files. You are correct. The <br> elements are causing the blank new lines. You don't need the CSS reset, so just add the following CSS in a <style> element in the <head> element: br { display: none; }
p br { display: inline; }
This CSS will hide all <br> elements that are not in a paragraph.
Best Regards, Nevron Support Team
|
|
|
Tom Galczynski
|
|
Group: Forum Members
Last Active: 4 Years Ago
Posts: 29,
Visits: 87
|
Hi. I took the reset.css code and added it to my html before adding to the MailMessage body. The result is what you see in the file emailreset2output.txt. Then I took a look at the source after the message was displayed in Outlook. The result is what you see in the file emailreset2source.txt. As you can see, Outlook (and also Gmail, Thunderbird) adds several "<br>" commands throughout which probably is what accounts for the blank lines. Not sure if there is anything we can do about that?
|
|
|