From commons-user-return-15133-apmail-jakarta-commons-user-archive=jakarta.apache.org@jakarta.apache.org Thu Feb 09 20:16:03 2006 Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 56761 invoked from network); 9 Feb 2006 20:15:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Feb 2006 20:15:51 -0000 Received: (qmail 80754 invoked by uid 500); 9 Feb 2006 20:15:46 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 80735 invoked by uid 500); 9 Feb 2006 20:15:45 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 80724 invoked by uid 99); 9 Feb 2006 20:15:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2006 12:15:45 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [199.88.205.1] (HELO mail2.basistech.net) (199.88.205.1) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2006 12:15:44 -0800 Received: from mail3.basistech.net ([10.1.1.99]) by mail2.basistech.net with Microsoft SMTPSVC(6.0.3790.1830); Thu, 9 Feb 2006 15:15:23 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Re: Email question.. Date: Thu, 9 Feb 2006 15:15:21 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Re: Email question.. Thread-Index: AcYtqVscuArHQq6ZTtGRAzZmSxrDtwAC26xQ From: "Michael Atlas" To: "Jakarta Commons Users List" X-OriginalArrivalTime: 09 Feb 2006 20:15:23.0333 (UTC) FILETIME=[8EB70F50:01C62DB5] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N The method .send() returns a String value after doing the actual mailing action. By assigning the return value of send() to a String variable, you can inspect the return value of the method call after you called it. Before, you were sending the message once, then sending the message again and checking the return value on the second call to .send(). Imagine that the .send() method looks something like this inside: public String send() { Mailserver.send(msgBody); //mail goes out into internet return Mailserver.lastsentmessagestatus(); //result of this method call gets returned in a string } -----Original Message----- From: news [mailto:news@sea.gmane.org] On Behalf Of Frances Sent: Thursday, February 09, 2006 1:50 PM To: commons-user@jakarta.apache.org Subject: Re: Email question.. Michael Atlas wrote: > Try this: >=20 > String emailStatus =3D email.send(); > if(emailStatus.equals("")) throw new Exception ("Sending of message=20 > failed."); that did it.. thank you very much....:) (still don't get how you can call a method by just putting name of method in a string... but I guess that's for another forum.......;) >=20 >=20 >=20 > -----Original Message----- > From: news [mailto:news@sea.gmane.org] On Behalf Of Frances > Sent: Thursday, February 09, 2006 1:16 PM > To: commons-user@jakarta.apache.org > Subject: Email question..=20 >=20 > when send e-mail w/Jakarta Commons Email Package e-mail gets sent > twice.. here's relevant code: >=20 > email.setHtmlMsg(msgBody); > email.send(); > if (email.send().equals("")) throw new Exception ("Sending of message > failed."); >=20 > only wait it gets sent only once is if I take out if(email....) line.. > why does this method return a string? maybe I'm not doing the check > right? would appreciate suggestions.. thank you... >=20 > Frances >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org