geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Andrushchak <us...@dekasoft.com.ua>
Subject Re: javamail
Date Mon, 23 Jan 2006 10:42:09 GMT
Thank You a lot Jakob!

At last it worked. :-)
I've added
            message.setFrom(InternetAddress.getLocalAddress(session));
to bean and it works!

Configuration is the same as last time.

Guys, thanks all of you for support!

Best regards,
Alex Andrushchak

Jakob Færch wrote:

>
>
> Alex Andrushchak wrote:
>
>> I've done next step, but still have problems:
>> Sending the message...SessionMailerBean.send: checkpoint 1.
>> connecting to 192.168.1.2
>> connected to 192.168.1.2
>> received : 220 gate.dekasoft.com.ua ESMTP Postfix
>> sent: HELO alex
>> received : 250 gate.dekasoft.com.ua
>> Failed !
>> Cannot send the message with MailerBean:java.lang.Exception: The 
>> message can not
>> be send : error 
>> (org.apache.geronimo.javamail.transport.smtp.SMTPTransportExcep
>> tion: no FROM address)
>
>
> Hi Alex
>
> Just one more idea; I checked the Adventure Builder code to see if I 
> was able to see any differences from your code.
>
> The Adventure Builder code calls the method setFrom() on the 
> MimeMessage object before attempting to send it.
>
> The javadoc for the geronimo implementation of the method specifies:
>     * If session is not null, we first look for an address specified in
>     * its "mail.from" property; if this is not set, we look at its
>     * "mail.user" and "mail.host" properties and if both are not null
>     * then an address of he form "${mail.user}@${mail.host}" is created.
>     * If this fails to give an address, then an attempt is made to
>     * create an address by combining the value of the "user.name"
>     * System property with the value returned from
>     * InetAddress.getLocalHost().getHostName().
>
> So it seems this might be the key to get the mail.from property picked 
> up.
>
> Could you try adding the call to message.setFrom()?
>
> Jakob
>


Mime
View raw message