commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Baranski" <list-subscripti...@secmgmt.com>
Subject RE: [Mail] Hangs on send()
Date Tue, 13 Oct 2009 13:12:30 GMT
OK, here's the code, and I get no more information, just hangs on the send()
(and will hang for days).

Properties props = new Properties();
            props.put("mail.debug", new Boolean(true));
            Session session = Session.getInstance(props, null);
            
                // Create the email message
            MultiPartEmail email = new MultiPartEmail();
            email.setMailSession(session);
            
            email.setHostName(this.mailServer);
            for(int i = 0 ; i < this.toEmail.length ; i++)
            {
                email.addTo(this.toEmail[i]);
            }
                
            email.setFrom(this.fromEmail);
            if(this.emailSubject != null)
            {
                email.setSubject(this.emailSubject);
            }
            else
            {
                email.setSubject("No Subject");
            }
                
            if(this.getMessage() != null)
            {
                email.setMsg(this.getMessage());
            }
            else
            {
                email.setMsg("No Message Provided");
            }
                
                // add the attachment
            email.attach(attachment);
            log.debug("Sending email via " + this.mailServer);
            log.debug("Email: " + email);

>-----Original Message-----
>From: Siegfried Goeschl [mailto:siegfried.goeschl@it20one.at]
>Sent: Saturday, October 10, 2009 4:00 PM
>To: Commons Users List
>Subject: Re: [Mail] Hangs on send()
>
>Hi Mike,
>
>have a look at
>http://java.sun.com/products/javamail/javadocs/overview-summary.html and
>"mail.debug"
>
>Cheers,
>
>Siegfried Goeschl
>
>Mike Baranski wrote:
>> My app hangs on send, but I can telnet to port 25 on the mail server
>I'm
>> using and send an email.
>>
>> Can someone explain to me how to turn on debug for the commons-mail
>and see
>> what's hanging?
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>For additional commands, e-mail: user-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message