• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ERJavaMail - work only in debug !
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERJavaMail - work only in debug !


  • Subject: Re: ERJavaMail - work only in debug !
  • From: Pierre Gilquin <email@hidden>
  • Date: Fri, 28 Sep 2012 09:03:49 +0200

I noticed a crazy thing.

In debug mode, I have really to step over the line 		message.sendMail();

otherwise the mail is not sent.


For example, if I remove all breakpoint and launch in debug, the mail is not sent !!


These are both from running inside of Eclipse?  The run mode one looks like it is blocking connecting to the mail server.  Do you have different properties or application arguments in your Debug launch configuration?  I'd print out all of the mail server related stuff to ensure it is the same.  My guess is that it is not.


Chuck


On 2012-09-27, at 8:14 AM, Pierre Gilquin wrote:

The logs :


1) from run mode

javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtpauth.bluewin.ch", port 587, isSSL false

and nothing more !!!


2 ) in debug mode


javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtpauth.bluewin.ch", port 587, isSSL false
220 zhbdzmsp-smta13.bluewin.ch ESMTP Service ready
DEBUG SMTP: connected to host "smtpauth.bluewin.ch", port: 587

EHLO pierre-desktop
250-zhbdzmsp-smta13.bluewin.ch
250-8BITMIME
250-PIPELINING
250-HELP
250-AUTH=LOGIN
250-AUTH LOGIN CRAM-MD5 DIGEST-MD5
250 SIZE 26214400
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "HELP", arg ""
DEBUG SMTP: Found extension "AUTH=LOGIN", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN CRAM-MD5 DIGEST-MD5"
DEBUG SMTP: Found extension "SIZE", arg "26214400"
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP: check mechanisms: LOGIN PLAIN DIGEST-MD5
AUTH LOGIN
334 VXNlcm5hbWU6
cGdpbHF1aW4=
334 UGFzc3dvcmQ6
c2dlZzEyMzQ=
235 LOGIN authentication successful
NOOP
250 NOOP
DEBUG SMTP: use8bit false
MAIL FROM:<>
250 MAIL FROM:<xx> OK
RCPT TO:<xx>
250 RCPT TO:<xx> OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP:   xx
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Date: Thu, 27 Sep 2012 17:03:45 +0200 (CEST)
From: xx
To: xx
Message-ID: <24164377.1.1348758225131.JavaMail.pierre@pierre-desktop>
Subject: Mon test envoi mail avec ERJavaMail
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_Part_0_9958945.1348758224914"

------=_Part_0_9958945.1348758224914
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
=09<head>
=09=09<title>Untitled</title>
=09</head>
=09<body>
Il etait 27 sept. 2012 17:03:39 quand j'ai =E9t=E9 envoy=E9
=09</body>
</html>

------=_Part_0_9958945.1348758224914--
.
250 <email@hidden> Mail accepted
QUIT
221 zhbdzmsp-smta13.bluewin.ch QUIT







maybe user-permissions issues?
are you certain you can send as the user who's running WO and all?
On Sep 27, 2012, at 6:05 AM, Pierre Gilquin <email@hidden> wrote:
Hi all,



I (try to) sent mail with ERJavaMail framework.

This is done in my Application class at start time.


The "funny" thing is that the mail is sent when I am in debug after executing the line : message.sendMail();

With normal execution, nothing happens and the mail is not sent !


Is there something that is better initialise where running in debug mode ?

Any idea for fixing this ?


Thanks in advance


Pierre




The code is like this :

WOContext mailContext = new WOContext( new WORequest("GET","/","HTTP/1.0",null,null, null));
Invitation invitation =  (Invitation)pageWithName("Invitation",mailContext);

// set some data in the component
invitation.setXXX
try {
URL logoURL = resourceManager().pathURLForResourceNamed("logo.png", null, null);
URL signatureURL = resourceManager().pathURLForResourceNamed("signature.png", null, null);

File logo = new File(logoURL.toURI());
File signature = new File(signatureURL.toURI());

ERMailAttachment imageLogo = new ERMailFileAttachment("logo.png","<imageLogo>",logo);
		    ERMailAttachment imageSignature = new ERMailFileAttachment("signature.png","<imageSignature>",signature);

ERMailDeliveryHTML message = new ERMailDeliveryHTML();
message.setComponent(invitation);

message.setSubject("My subject");
message.addInlineAttachment(imageLogo);
message.addInlineAttachment(imageSignature);

message.setToAddress("email@hidden");

message.setFromAddress("email@hidden");

// send the mail assynchronously
message.sendMail();
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ERJavaMail - work only in debug !
      • From: Chuck Hill <email@hidden>
References: 
 >ERJavaMail - work only in debug ! (From: Pierre Gilquin <email@hidden>)
 >Re: ERJavaMail - work only in debug ! (From: Jesse Tayler <email@hidden>)
 >Re: ERJavaMail - work only in debug ! (From: Pierre Gilquin <email@hidden>)
 >Re: ERJavaMail - work only in debug ! (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: ERJavaMail - work only in debug !
  • Next by Date: Re: ERJavaMail - work only in debug !
  • Previous by thread: Re: ERJavaMail - work only in debug !
  • Next by thread: Re: ERJavaMail - work only in debug !
  • Index(es):
    • Date
    • Thread