You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dominik Stadler (JIRA)" <ji...@apache.org> on 2012/10/16 07:09:04 UTC
[jira] [Updated] (EMAIL-121) Outlook displays an email incorrectly
if there is a newline in the Subject
[ https://issues.apache.org/jira/browse/EMAIL-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dominik Stadler updated EMAIL-121:
----------------------------------
Attachment: mail-wrong.png
mail-ok.png
display of the email in Outlook without and with newline
> Outlook displays an email incorrectly if there is a newline in the Subject
> --------------------------------------------------------------------------
>
> Key: EMAIL-121
> URL: https://issues.apache.org/jira/browse/EMAIL-121
> Project: Commons Email
> Issue Type: Bug
> Affects Versions: 1.3
> Environment: 1.3 SNAPSHOT, Outlook "14.0.6123.5001"
> Reporter: Dominik Stadler
> Priority: Critical
> Attachments: mail-ok.png, mail-wrong.png
>
>
> Agreed it is not very useful, but it took me quite a while to figure out why outlook did not display the email correctly.
> Here a simplified reproducer:
> {quote}
> public class EmailSendingReproducer {
> private static final String MESSAGE_HTML =
> "<html>" +
> "<body>" +
> "Sincerly<br/>" +
> "Your hard-working setup application<br/>" +
> "</body></html>";
> private static final String MESSAGE_TXT =
> "Sincerly<br/>" +
> "Your hard-working setup application<br/>" +
> "\n";
> public static void main(String[] args) throws Exception {
> sendEmail("\n1Setup job '[setup,sync]' finished on machine");
> sendEmail("Setup job '[setup,sync]' finished on machine");
> System.out.println("Done");
> }
> public static void sendEmail(String subject) throws IOException, EmailException, AddressException {
> final ImageHtmlEmail email = new ImageHtmlEmail();
> email.setDataSourceResolver(new DataSourceResolverImpl(new File(".").toURI().toURL(), true));
> // set properties on the Email object
> email.setHostName("somesmtphost");
> email.setSmtpPort(25);
> email.setTo(Arrays.asList(InternetAddress.parse("whereyouare@example.com")));
> email.setFrom("test@example.com");
> email.setSubject(subject);
> email.setMsg(MESSAGE_TXT);
> email.setHtmlMsg(MESSAGE_HTML);
> email.send();
> }
> {quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira