You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Rajarshi (JIRA)" <ji...@apache.org> on 2008/03/14 04:35:24 UTC
[jira] Created: (EMAIL-73) Format generated by HtmlEmail component
causing problem
Format generated by HtmlEmail component causing problem
-------------------------------------------------------
Key: EMAIL-73
URL: https://issues.apache.org/jira/browse/EMAIL-73
Project: Commons Email
Issue Type: Bug
Reporter: Rajarshi
We are facing some problems while we are using Apache HtmlEmail component for sending emails.
The content of the email that we have as part of our application does not have any <pre> tags defined. The content defined is as below:
<html><body>
<p>
</p>
<p>
</p>
<font face="arial,helvetica,sans-serif" size="2">13-03-2008 <br />
</font>
</p>
Dear Sir/Madam, <br />
</font><font face="arial,helvetica,sans-serif" size="2">
<div align="center">
<strong>This is an test email</strong>
</div>
<p>
<br />
This is to test the pre tags<br />
<br />
</font><font face="arial,helvetica,sans-serif" size="2">Yours faithfully,<br />
<img><br />
XYZ</font>
</p>
</font>
</body></html>
------------------------------------------------------------------------------------------------------------------------------------------------
But as soon as we are using the below code
if (iataMail.isHtmlFormat()) {
HtmlEmail htmlEmail = new HtmlEmail();
if (StringUtils.isNotEmpty(iataMail.getMessage())) {
htmlEmail.setHtmlMsg(iataMail.getMessage());
}
// set htmlEmail to email reference
email = htmlEmail;
}
the email message is been wrapped with a <pre> tag which leads to the extra spaces in the email content when viewed through any mail client
We need your help to find out if this is an issue with the Apache mailing component / something that we need to take care in order to resolve this.
Please also find attached the content of the email been generated with and without pre tags
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (EMAIL-73) Format generated by HtmlEmail
component causing problem
Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EMAIL-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695915#action_12695915 ]
Siegfried Goeschl commented on EMAIL-73:
----------------------------------------
Unfortunately I can't find any attachments .... :-(
> Format generated by HtmlEmail component causing problem
> -------------------------------------------------------
>
> Key: EMAIL-73
> URL: https://issues.apache.org/jira/browse/EMAIL-73
> Project: Commons Email
> Issue Type: Bug
> Reporter: Rajarshi
>
> We are facing some problems while we are using Apache HtmlEmail component for sending emails.
>
> The content of the email that we have as part of our application does not have any <pre> tags defined. The content defined is as below:
>
> <html><body>
> <p>
> </p>
> <p>
> </p>
> <font face="arial,helvetica,sans-serif" size="2">13-03-2008 <br />
> </font>
> </p>
> Dear Sir/Madam, <br />
> </font><font face="arial,helvetica,sans-serif" size="2">
> <div align="center">
> <strong>This is an test email</strong>
> </div>
> <p>
> <br />
> This is to test the pre tags<br />
> <br />
> </font><font face="arial,helvetica,sans-serif" size="2">Yours faithfully,<br />
> <img><br />
> XYZ</font>
> </p>
> </font>
> </body></html>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------
> But as soon as we are using the below code
>
> if (iataMail.isHtmlFormat()) {
> HtmlEmail htmlEmail = new HtmlEmail();
> if (StringUtils.isNotEmpty(iataMail.getMessage())) {
> htmlEmail.setHtmlMsg(iataMail.getMessage());
> }
> // set htmlEmail to email reference
> email = htmlEmail;
> }
>
> the email message is been wrapped with a <pre> tag which leads to the extra spaces in the email content when viewed through any mail client
>
> We need your help to find out if this is an issue with the Apache mailing component / something that we need to take care in order to resolve this.
> Please also find attached the content of the email been generated with and without pre tags
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (EMAIL-73) Format generated by HtmlEmail
component causing problem
Posted by "Allan Flatoff (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EMAIL-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12728973#action_12728973 ]
Allan Flatoff commented on EMAIL-73:
------------------------------------
I have been hit with the same issue. Our users are complaining that their emails aren't word-wrapping.
This is because when you send an email using the HTMLEmail class, Commons Email sticks a <pre> tag in the message
Code from HTMLEmail.java:
/** prefix for default HTML mail */
private static final String HTML_MESSAGE_START = "<html><body><pre>";
/** suffix for default HTML mail */
private static final String HTML_MESSAGE_END = "</pre></body></html>";
I don't see any reason there needs to be a <pre> tag stuck in there. If you want one, you can always put one in yourself.
I recommend this be taken out in the next version.
> Format generated by HtmlEmail component causing problem
> -------------------------------------------------------
>
> Key: EMAIL-73
> URL: https://issues.apache.org/jira/browse/EMAIL-73
> Project: Commons Email
> Issue Type: Bug
> Reporter: Rajarshi
>
> We are facing some problems while we are using Apache HtmlEmail component for sending emails.
>
> The content of the email that we have as part of our application does not have any <pre> tags defined. The content defined is as below:
>
> <html><body>
> <p>
> </p>
> <p>
> </p>
> <font face="arial,helvetica,sans-serif" size="2">13-03-2008 <br />
> </font>
> </p>
> Dear Sir/Madam, <br />
> </font><font face="arial,helvetica,sans-serif" size="2">
> <div align="center">
> <strong>This is an test email</strong>
> </div>
> <p>
> <br />
> This is to test the pre tags<br />
> <br />
> </font><font face="arial,helvetica,sans-serif" size="2">Yours faithfully,<br />
> <img><br />
> XYZ</font>
> </p>
> </font>
> </body></html>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------
> But as soon as we are using the below code
>
> if (iataMail.isHtmlFormat()) {
> HtmlEmail htmlEmail = new HtmlEmail();
> if (StringUtils.isNotEmpty(iataMail.getMessage())) {
> htmlEmail.setHtmlMsg(iataMail.getMessage());
> }
> // set htmlEmail to email reference
> email = htmlEmail;
> }
>
> the email message is been wrapped with a <pre> tag which leads to the extra spaces in the email content when viewed through any mail client
>
> We need your help to find out if this is an issue with the Apache mailing component / something that we need to take care in order to resolve this.
> Please also find attached the content of the email been generated with and without pre tags
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (EMAIL-73) Format generated by HtmlEmail
component causing problem
Posted by "Dominik Stadler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EMAIL-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798231#action_12798231 ]
Dominik Stadler commented on EMAIL-73:
--------------------------------------
Have you tried calling the method "setHtmlMsg()" instead of "setMsg()" for HTML emails? The HTML_MESSAGE_START is only used in "setMsg", when I use "setHtmlMsg" (and "setTextMsg" when I want to have a text-only representation as well), everything is fine!
> Format generated by HtmlEmail component causing problem
> -------------------------------------------------------
>
> Key: EMAIL-73
> URL: https://issues.apache.org/jira/browse/EMAIL-73
> Project: Commons Email
> Issue Type: Bug
> Reporter: Rajarshi
>
> We are facing some problems while we are using Apache HtmlEmail component for sending emails.
>
> The content of the email that we have as part of our application does not have any <pre> tags defined. The content defined is as below:
>
> <html><body>
> <p>
> </p>
> <p>
> </p>
> <font face="arial,helvetica,sans-serif" size="2">13-03-2008 <br />
> </font>
> </p>
> Dear Sir/Madam, <br />
> </font><font face="arial,helvetica,sans-serif" size="2">
> <div align="center">
> <strong>This is an test email</strong>
> </div>
> <p>
> <br />
> This is to test the pre tags<br />
> <br />
> </font><font face="arial,helvetica,sans-serif" size="2">Yours faithfully,<br />
> <img><br />
> XYZ</font>
> </p>
> </font>
> </body></html>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------
> But as soon as we are using the below code
>
> if (iataMail.isHtmlFormat()) {
> HtmlEmail htmlEmail = new HtmlEmail();
> if (StringUtils.isNotEmpty(iataMail.getMessage())) {
> htmlEmail.setHtmlMsg(iataMail.getMessage());
> }
> // set htmlEmail to email reference
> email = htmlEmail;
> }
>
> the email message is been wrapped with a <pre> tag which leads to the extra spaces in the email content when viewed through any mail client
>
> We need your help to find out if this is an issue with the Apache mailing component / something that we need to take care in order to resolve this.
> Please also find attached the content of the email been generated with and without pre tags
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (EMAIL-73) Format generated by HtmlEmail component
causing problem
Posted by "Siegfried Goeschl (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/EMAIL-73?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Siegfried Goeschl resolved EMAIL-73.
------------------------------------
Assignee: Siegfried Goeschl
Resolution: Cannot Reproduce
Added a test case "HtmlEmailTest#testSendWithPlainTextButNoHtmlContent" but I'm unable to reproduce the problem.
> Format generated by HtmlEmail component causing problem
> -------------------------------------------------------
>
> Key: EMAIL-73
> URL: https://issues.apache.org/jira/browse/EMAIL-73
> Project: Commons Email
> Issue Type: Bug
> Reporter: Rajarshi
> Assignee: Siegfried Goeschl
>
> We are facing some problems while we are using Apache HtmlEmail component for sending emails.
>
> The content of the email that we have as part of our application does not have any <pre> tags defined. The content defined is as below:
>
> <html><body>
> <p>
> </p>
> <p>
> </p>
> <font face="arial,helvetica,sans-serif" size="2">13-03-2008 <br />
> </font>
> </p>
> Dear Sir/Madam, <br />
> </font><font face="arial,helvetica,sans-serif" size="2">
> <div align="center">
> <strong>This is an test email</strong>
> </div>
> <p>
> <br />
> This is to test the pre tags<br />
> <br />
> </font><font face="arial,helvetica,sans-serif" size="2">Yours faithfully,<br />
> <img><br />
> XYZ</font>
> </p>
> </font>
> </body></html>
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------
> But as soon as we are using the below code
>
> if (iataMail.isHtmlFormat()) {
> HtmlEmail htmlEmail = new HtmlEmail();
> if (StringUtils.isNotEmpty(iataMail.getMessage())) {
> htmlEmail.setHtmlMsg(iataMail.getMessage());
> }
> // set htmlEmail to email reference
> email = htmlEmail;
> }
>
> the email message is been wrapped with a <pre> tag which leads to the extra spaces in the email content when viewed through any mail client
>
> We need your help to find out if this is an issue with the Apache mailing component / something that we need to take care in order to resolve this.
> Please also find attached the content of the email been generated with and without pre tags
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.