commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Hoffer <>
Subject Re: [email] Email attachment is inline for some reason
Date Wed, 06 Jul 2011 12:11:32 GMT
I've had another email failure this time it's usage with no attachment.
I'll paste the code below.  It's dropping the subject...same as the other
case.  Note that (No Subject) is being added by GMail on the receiving side
as all emails with no subject show that.

try {
            Email email = new SimpleEmail();
            final String gMailUsername = appProperties.getGMailUsername();
            email.setAuthenticator(new DefaultAuthenticator(gMailUsername,
            email.setSubject("App System Error");
            String[] toEmails = appProperties.getSystemErrorSendToEmails();
            for (String toEmail : toEmails) {
        } catch (EmailException e) {
            log.error("Failed to send system email", e);


On Wed, Jul 6, 2011 at 3:08 AM, Siegfried Goeschl <> wrote:

> Hi David,
> that sound a little bit strange - can you have a look at the JUnit tests?
> There is an "EmailLiveTest" which allows sending real emails with a bit of
> tinkering - I suggest to have a look at the test, configure them to send
> test emails to your email account and then double-check your production
> code.
> Cheers,
> Siegfried Goeschl
> On 06.07.11 05:46, David Hoffer wrote:
>> I have a strange problem.  I've used commons-email for a while now
>> with good success but now all of the sudden it isn't working right and
>> I don't know why.  The emails have 3 problems:
>> 1. Although I attach a file to the email as an attachment it is
>> received inline as base64 encoded text.  I.e. my code does this:
>> attachment.setDisposition(**EmailAttachment.ATTACHMENT);
>> 2. The subject is replaced with this:  (no subject)
>> 3. The from and reply to email addresses are dropped and replaced with
>> the email address used in as the authenticator.
>> This is only a problem when I run the code on the production server
>> which is Linux (hosted virtual server).  It works as expected on
>> Windows during test.  This code on the Linux server used to work but
>> it was a prior build, not sure what changed but nothing in the email
>> code changed...just a different file being sent with different
>> description.
>> Any ideas why these three things might be occurring?
>> -Dave
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@commons.**<>
>> For additional commands, e-mail:
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@commons.**<>
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message