commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Stadler (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (EMAIL-121) Outlook displays an email incorrectly if there is a newline in the Subject
Date Tue, 16 Oct 2012 05:09:05 GMT

     [ https://issues.apache.org/jira/browse/EMAIL-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dominik Stadler updated EMAIL-121:
----------------------------------

    Description: 
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:

{code}
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();
	}
{code}

  was:
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}

    
> 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:
> {code}
> 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();
> 	}
> {code}

--
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

Mime
View raw message