You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rhino <rh...@sympatico.ca> on 2006/01/07 00:19:43 UTC

Problem with mail task

I have a fairly trivial 'mail' task in my Ant script that is giving me this 
output:
[mail] Failed to initialise MIME mail: javax/mail/MessagingException

[mail] Sending email: Update ZoneEdit Password

[mail] Sent email with 0 attachments

Even though the email was sent and received without difficulty, I am 
concerned about the first line of output and would like to make this go away 
if it's not going to be a major pain.

The only parameters I am using are 'mailhost', 'from address', 'replyto 
address', 'cc address', and 'message' and all of them appear to have valid 
values since the email is sent and received fine.

What can I do to make that error message go away?

By the way, I've copied this 'mail' task from an older script but according 
to the article on 'mail' in the Ant 1.6.5 manual, the correct parameters to 
use are 'from', 'replyto', and 'cclist' _NOT_ 'from address', 'replyto 
address', 'cc address'. Why are my parameters working even though they are 
wrong? And why do I get an error when I try to use the parameters in the 
manual? Strangely, the examples used for the 'mail' task also use 'from 
address', and 'replyto address', making the article inconsistent with 
itself! What's the story here?

I am using Ant 1.6.5 in Windows XP Pro (SP2 applied).

---
Rhino



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date: 05/01/2006


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem with mail task

Posted by Reeganz <sa...@yahoo.com>.
This issue is because of the classpath:
Add latest mail.jar & activation.jar to your ANT_HOME/lib and
then run the ant task through command prompt, it will work....
Reply back if you face any issues...


Petar Tahchiev wrote:
> 
> On 07/01/06, Rhino <rh...@sympatico.ca> wrote:
>>
>> I have a fairly trivial 'mail' task in my Ant script that is giving me
>> this
>> output:
>> [mail] Failed to initialise MIME mail: javax/mail/MessagingException
>>
>> [mail] Sending email: Update ZoneEdit Password
>>
>> [mail] Sent email with 0 attachments
>>
>> Even though the email was sent and received without difficulty, I am
>> concerned about the first line of output and would like to make this go
>> away
>> if it's not going to be a major pain.
>>
>> The only parameters I am using are 'mailhost', 'from address', 'replyto
>> address', 'cc address', and 'message' and all of them appear to have
>> valid
>> values since the email is sent and received fine.
>>
>> What can I do to make that error message go away?
>>
>> By the way, I've copied this 'mail' task from an older script but
>> according
>> to the article on 'mail' in the Ant 1.6.5 manual, the correct parameters
>> to
>> use are 'from', 'replyto', and 'cclist' _NOT_ 'from address', 'replyto
>> address', 'cc address'. Why are my parameters working even though they
>> are
>> wrong? And why do I get an error when I try to use the parameters in the
>> manual? Strangely, the examples used for the 'mail' task also use 'from
>> address', and 'replyto address', making the article inconsistent with
>> itself! What's the story here?
>>
>> I am using Ant 1.6.5 in Windows XP Pro (SP2 applied).
>>
>> ---
>> Rhino
>>
>>
>>
>> --
>> No virus found in this outgoing message.
>> Checked by AVG Free Edition.
>> Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date:
>> 05/01/2006
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> The message: "Failed to initialise MIME mail" usually comes when Ant can't
> find Sun's JavaMail API in the ANT_HOME/lib directory. In case ant doesn't
> find activation.jar and mail.jar in those directory it uses its own
> implementation for sending mail. Maybe you use some old version of
> actvation.jar and mail.jar? Or maybe the content type of your message is
> not
> text/plain?
> --
> Regards, Petar!
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-mail-task-tp2249069p18971198.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem with mail task

Posted by Rhino <rh...@sympatico.ca>.
----- Original Message ----- 
From: "Petar Tahchiev" <pa...@gmail.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, January 07, 2006 7:22 AM
Subject: Re: Problem with mail task


On 07/01/06, Rhino <rh...@sympatico.ca> wrote:
>
> I have a fairly trivial 'mail' task in my Ant script that is giving me
> this
> output:
> [mail] Failed to initialise MIME mail: javax/mail/MessagingException
>
> [mail] Sending email: Update ZoneEdit Password
>
> [mail] Sent email with 0 attachments
>
> Even though the email was sent and received without difficulty, I am
> concerned about the first line of output and would like to make this go
> away
> if it's not going to be a major pain.
>
> The only parameters I am using are 'mailhost', 'from address', 'replyto
> address', 'cc address', and 'message' and all of them appear to have valid
> values since the email is sent and received fine.
>
> What can I do to make that error message go away?
>
> By the way, I've copied this 'mail' task from an older script but
> according
> to the article on 'mail' in the Ant 1.6.5 manual, the correct parameters
> to
> use are 'from', 'replyto', and 'cclist' _NOT_ 'from address', 'replyto
> address', 'cc address'. Why are my parameters working even though they are
> wrong? And why do I get an error when I try to use the parameters in the
> manual? Strangely, the examples used for the 'mail' task also use 'from
> address', and 'replyto address', making the article inconsistent with
> itself! What's the story here?
>
> I am using Ant 1.6.5 in Windows XP Pro (SP2 applied).
>
> ---
> Rhino
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date:
> 05/01/2006
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
The message: "Failed to initialise MIME mail" usually comes when Ant can't
find Sun's JavaMail API in the ANT_HOME/lib directory. In case ant doesn't
find activation.jar and mail.jar in those directory it uses its own
implementation for sending mail. Maybe you use some old version of
actvation.jar and mail.jar? Or maybe the content type of your message is not
text/plain?
--
Regards, Petar!



--------------------------------------------------------------------------------

Thank you, Petar, that was exactly the problem! It all works perfectly now.

Rhino







-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.15/223 - Release Date: 06/01/2006


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Problem with mail task

Posted by Petar Tahchiev <pa...@gmail.com>.
On 07/01/06, Rhino <rh...@sympatico.ca> wrote:
>
> I have a fairly trivial 'mail' task in my Ant script that is giving me
> this
> output:
> [mail] Failed to initialise MIME mail: javax/mail/MessagingException
>
> [mail] Sending email: Update ZoneEdit Password
>
> [mail] Sent email with 0 attachments
>
> Even though the email was sent and received without difficulty, I am
> concerned about the first line of output and would like to make this go
> away
> if it's not going to be a major pain.
>
> The only parameters I am using are 'mailhost', 'from address', 'replyto
> address', 'cc address', and 'message' and all of them appear to have valid
> values since the email is sent and received fine.
>
> What can I do to make that error message go away?
>
> By the way, I've copied this 'mail' task from an older script but
> according
> to the article on 'mail' in the Ant 1.6.5 manual, the correct parameters
> to
> use are 'from', 'replyto', and 'cclist' _NOT_ 'from address', 'replyto
> address', 'cc address'. Why are my parameters working even though they are
> wrong? And why do I get an error when I try to use the parameters in the
> manual? Strangely, the examples used for the 'mail' task also use 'from
> address', and 'replyto address', making the article inconsistent with
> itself! What's the story here?
>
> I am using Ant 1.6.5 in Windows XP Pro (SP2 applied).
>
> ---
> Rhino
>
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date:
> 05/01/2006
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
The message: "Failed to initialise MIME mail" usually comes when Ant can't
find Sun's JavaMail API in the ANT_HOME/lib directory. In case ant doesn't
find activation.jar and mail.jar in those directory it uses its own
implementation for sending mail. Maybe you use some old version of
actvation.jar and mail.jar? Or maybe the content type of your message is not
text/plain?
--
Regards, Petar!