Re: ERJavaMail problem

David LeBer <[email protected]> Wed, 7 Sep 2011 09:18:48 -0400
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
On 2011-09-07, at 9:09 AM, Ond=C5=99ej =C4=8Cada wrote:

> David,
>=20
> On Sep 7, 2011, at 2:01 PM, David LeBer wrote:
>> On 2011-09-07, at 1:01 AM, Ond=C5=99ej =C4=8Cada wrote:
>>=20
>>> Hello there,
>>>=20
>>> I've bumped into another problem. Since I need a bit more for mail =
than WOMailDelivery can give, I've decided to use ERJavaMail.
>>>=20
>>> I went by this quickstart recommendation:
>>>=20
>>> =
http://homepage.mac.com/kelleherk/iblog/C183784902/E2093239404/index.html

Hmm, yeah: "This article is OBSOLETE and the content has been removed!"

>>>=20
>>> First problem was that I've kept getting the "When setting =
'er.javamail.centralize=3Dtrue' (which means you just test sending =
mails), you must also give a valid '[email protected]' =
to which the mails are sent" error, although the Properties are set up =
all right.
>>>=20
>>> Well I've downloaded the Wonder sources too, and quickly found the =
cause is that the quickstart self-evidently forgot to point out that one =
must first send the initializeFrameworkFromSystemProperties to the =
ERJavaMail shared instance. Never mind, I've added the intialization.
>>>=20
>>> Nevertheless, from the method I kept getting null pointer =
exceptions. Digging deeper into the source and trying it step by step =
I've found the cause to be the ERJavaMail.isValidEmail method, which =
raises the exception.
>>>=20
>>> Guess I could dive into its pattern stuff as well, but I've already =
spent too many hours on something which should "just work" :(
>>>=20
>>> Any hints?
>>=20
>> Does your application/session extend ERXApplication/ERXSession?
>=20
> I don't use either -- the only part of ER/Wonder I (am trying to) use =
is ERJavaMail. The rest is "pure WebObjects", so to speak. So, there's =
just -- as always -- Application extending WOApplication and Session =
extending WOSession.
>=20
> I've inferred from the "quickstart" above that it should be possible? =
Is it not, i.e., can't ERJM work "alone"?
>=20
> Thanks a lot and best

ERXApplication is going to handle the properties setup and framework =
initialization for ERJavaMail for you. You'll need to handle that =
yourself if you don't extend it.=20

;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: 	http://codeferous.com
blog: 	http://davidleber.net
profile:	http://www.linkedin.com/in/davidleber
twitter:	http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org