[Mail] Hangs on send()

4 messages Options
Embed this post
Permalink
Mike Baranski-2

[Mail] Hangs on send()

Reply Threaded More More options
Print post
Permalink
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: [hidden email]
For additional commands, e-mail: [hidden email]

Siegfried Goeschl

Re: [Mail] Hangs on send()

Reply Threaded More More options
Print post
Permalink
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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Mike Baranski-2

RE: [Mail] Hangs on send()

Reply Threaded More More options
Print post
Permalink
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:[hidden email]]
>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: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Mike Baranski-2

RE: [Mail] Hangs on send()

Reply Threaded More More options
Print post
Permalink
So, I am finally getting an exception:

Exception: Sending the email to the following server failed : secmgmt.com:25

Here is what's in the sendmail log:

Oct 13 10:27:27 www sendmail[9337]: n9DEONBs009337: collect: unexpected
close on connection from smcraleigh.secmgmt.com,
sender=<sqlemail@pictureperfect>


>-----Original Message-----
>From: Mike Baranski [mailto:[hidden email]]
>Sent: Tuesday, October 13, 2009 9:13 AM
>To: 'Commons Users List'; [hidden email]
>Subject: RE: [Mail] Hangs on send()
>
>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:[hidden email]]
>>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: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: [hidden email]
>>For additional commands, e-mail: [hidden email]
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]