geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DavidCAIT <>
Subject Geronimo Javamail: Email Subject Line Blank
Date Tue, 10 Feb 2009 17:39:22 GMT

I am migrating some code from Sun's JavaMail to Geronimo's JavaMail
implementation. The code is identical, but I have changed the library
dependency from Sun JavaMail to Geronimo JavaMail. 

However, Geronimo JavaMail now sends out the emails with a blank subject
line. Does anyone have any ideas about how to set the email subject line
using geronimo javamail? I have included my code sample below.


import java.util.Date;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

public class Mailer {

    public boolean sendMail(String recipient, String message) {
    Properties props = new Properties();
    props.put("", "");
    Session session = Session.getInstance(props);

    try {
        Message msg = new MimeMessage(session);

        //Set message attributes
        msg.setFrom(new InternetAddress(""));
        InternetAddress[] address = {new InternetAddress(recipient)};
        msg.setRecipients(Message.RecipientType.TO, address);

        // setting the subject line!
        msg.setSubject("Subject Line");

        msg.setSentDate(new Date());
    catch (MessagingException x) {
    return true; }

View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message