[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4465) Sending email with multiple <m:to> tags or with <ui:repeat> interation causes multiple "To:" header fields (doesn't work and not compliant with RFC-5322)

Robert Hare (JIRA) jira-events at lists.jboss.org
Mon Nov 2 12:26:06 EST 2009

Sending email with multiple <m:to> tags or with <ui:repeat> interation causes multiple "To:" header fields (doesn't work and not compliant with RFC-5322)

                 Key: JBSEAM-4465
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4465
             Project: Seam
          Issue Type: Bug
          Components: Mail
    Affects Versions: 2.2.0.GA
         Environment: Fedora 11, Seam 2.2.0.GA, Jboss 5.1.0.GA, 
            Reporter: Robert Hare
            Assignee: Pete Muir

Use of multiple <m:to> or iterated over with <ui:repeat> tags will cause multiple "To:" header fields as opposed to a comma separated address list on a single "To:" field as required by RFC-5322.  Very easy to duplicate and code is directly from examples.  Note this same behavior also occurs for <m:cc> fields.

I actually think I must be doing something wrong, since this seams like a major issue that would have had to have been discovered long before now, but the forums haven't helped and it's straight from the examples.

----- test.xhtml

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<ui:composition xmlns="http://www.w3.org/1999/xhtml"

    <ui:define name="body">
		<s:button value="test" action="#{testEmail.test}"/>

-----  TestEmail.java

package com.hc.skiclub.session;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.In;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.faces.Renderer;

public class TestEmail
    @In private FacesMessages facesMessages;
    @In (create=true) private Renderer renderer;

	public String test()
        // Send email.
        try {
            facesMessages.add("Email sent successfully");
        } catch (Exception e) {
            facesMessages.add("Email sending failed: " + e.getMessage());
            return "fail";
        return "success";

----- TestEmail.xhtm  (substitute in valid email address for "user at domain" below)

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<m:message xmlns="http://www.w3.org/1999/xhtml"
    <m:from name="Rob" address="user at domain"/>
    <m:to name="Rob1" address="user at domain" />
    <m:to name="Rob2" address="user at domain" />
    <m:subject>Test Email </m:subject>

----------- Example of mail message sent/received  (DOMAIN substituted for real domain), notice two "To:" headers.

>From rhare at DOMAIN  Mon Nov  2 12:19:07 2009
Return-Path: <rhare at DOMAIN>
Date: Mon, 2 Nov 2009 12:19:07 -0500
From: Rob <rhare at DOMAIN>
To: Rob1 <rhare at DOMAIN>
To: Rob2 <rhare at DOMAIN>
Subject: Test Email
Content-Type: multipart/mixed; 
Status: R

Part 1:
Content-Type: text/html; charset=ISO-8859-1
Content-Disposition: inline



This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list