You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Hankel <vh...@hotmail.com> on 2007/07/05 11:02:42 UTC

ANT auto-emailing of reports, mail task

Hi there,

Once again, I apologize for posting a question more related on ANT than
TestNG. But as far as I know, there is no such active and populated forums
for ANT, shame.

However, I think this subject would benefit from a large group of TestNG
users here, as automated tests suggested by TestNG take all its advantage
and sense with automating the emailing process.

To start with, here is the Apache ANT documenation on the Mail task. It
seems that mail also supports SSL secure protocol, so that's fine for the
vast majority of mail service providers.
http://ant.apache.org/manual/CoreTasks/mail.html


So here is my ANT target that causes me harm....

<target name="email-report" description="Email auto-generated REPORT">

<mail messagemimetype="text/plain" ssl="on" mailhost="smtp.gmail.com"
mailport="465" user="addr1@gmail.com" password="XXX" subject="Testing
Environment - TestNG report">
<from address="addr1@gmail.com"/>
<to address="receiver@gmail.com"/>
<message>The ${scenario} nightly build is completed, on date: ${DateStamp}.
Find the auto-generated report file attached.</message>
<attachments>
<fileset dir="Run\${scenario}\${DateStamp}">
<include name="emailable-report.html"/>
</fileset>
</attachments>
</mail>

</target>


So as you can see I am using gmail as a mail server, with my personal
account (addr1@) which will connect to the smtp gmail server to send the
attached report file to receiver@gmail.com.

Now I am wondering what am I doing wrong to get this odd result:

email-report:
[mail] Sending email: Testing Environment - TestNG report
[mail] Failed to send email: Could not connect to SMTP host: smtp.gmail.com,
port: 465


Unfortunately for me, I cannot count on more precisions about the failure.
The only thing I know is that the email has not been sent so far.


ANT's task "mail" is based on the Sun Java Activation Framework and the
(Mime)Mail archive. So I downloaded both the mail.jar and activation.jar
from Java Sun website, and placed them in the ANT\lib directory.

I also found some guidelines to use the <mimemail> ANT's task, which uses
JUnitMail.jar which is in the ANT\lib directory by default.
http://www.ibm.com/developerworks/java/library/j-junitmail/

Cannot have it working either.
I was wondering if there was some proxy issues in there...


EDIT >>>

Mmmh...
Using telnet's open smtp.gmail.com command, it's giving me the "could not
connect to" error. It might be a proxy or security problem I guess.

Does anybody know how to set up a proxy within the mail task? How do we
manage the connections to external servers, such as gmail for example?
Can you react to that poll and leave your feedbacks and experience with the
ANT "mail" task (Java Sun mail.jar & activation.jar).

Thank you. 
-- 
View this message in context: http://www.nabble.com/ANT-auto-emailing-of-reports%2C-mail-task-tf4028518.html#a11443093
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: ANT auto-emailing of reports, mail task

Posted by Tommy Nordgren <to...@comhem.se>.
I suggest you contact postmaster@gmail.com
with this question.
On 5 jul 2007, at 11.02, Hankel wrote:

>
> Hi there,
>
> Once again, I apologize for posting a question more related on ANT  
> than
> TestNG. But as far as I know, there is no such active and populated  
> forums
> for ANT, shame.
>
> However, I think this subject would benefit from a large group of  
> TestNG
> users here, as automated tests suggested by TestNG take all its  
> advantage
> and sense with automating the emailing process.
>
> To start with, here is the Apache ANT documenation on the Mail  
> task. It
> seems that mail also supports SSL secure protocol, so that's fine  
> for the
> vast majority of mail service providers.
> http://ant.apache.org/manual/CoreTasks/mail.html
>
>
> So here is my ANT target that causes me harm....
>
> <target name="email-report" description="Email auto-generated REPORT">
>
> <mail messagemimetype="text/plain" ssl="on" mailhost="smtp.gmail.com"
> mailport="465" user="addr1@gmail.com" password="XXX" subject="Testing
> Environment - TestNG report">
> <from address="addr1@gmail.com"/>
> <to address="receiver@gmail.com"/>
> <message>The ${scenario} nightly build is completed, on date: $ 
> {DateStamp}.
> Find the auto-generated report file attached.</message>
> <attachments>
> <fileset dir="Run\${scenario}\${DateStamp}">
> <include name="emailable-report.html"/>
> </fileset>
> </attachments>
> </mail>
>
> </target>
>
>
> So as you can see I am using gmail as a mail server, with my personal
> account (addr1@) which will connect to the smtp gmail server to  
> send the
> attached report file to receiver@gmail.com.
>
> Now I am wondering what am I doing wrong to get this odd result:
>
> email-report:
> [mail] Sending email: Testing Environment - TestNG report
> [mail] Failed to send email: Could not connect to SMTP host:  
> smtp.gmail.com,
> port: 465
>
>
> Unfortunately for me, I cannot count on more precisions about the  
> failure.
> The only thing I know is that the email has not been sent so far.
>
>
> ANT's task "mail" is based on the Sun Java Activation Framework and  
> the
> (Mime)Mail archive. So I downloaded both the mail.jar and  
> activation.jar
> from Java Sun website, and placed them in the ANT\lib directory.
>
> I also found some guidelines to use the <mimemail> ANT's task,  
> which uses
> JUnitMail.jar which is in the ANT\lib directory by default.
> http://www.ibm.com/developerworks/java/library/j-junitmail/
>
> Cannot have it working either.
> I was wondering if there was some proxy issues in there...
>
>
> EDIT >>>
>
> Mmmh...
> Using telnet's open smtp.gmail.com command, it's giving me the  
> "could not
> connect to" error. It might be a proxy or security problem I guess.
>
> Does anybody know how to set up a proxy within the mail task? How  
> do we
> manage the connections to external servers, such as gmail for example?
> Can you react to that poll and leave your feedbacks and experience  
> with the
> ANT "mail" task (Java Sun mail.jar & activation.jar).
>
> Thank you.
> -- 
> View this message in context: http://www.nabble.com/ANT-auto- 
> emailing-of-reports%2C-mail-task-tf4028518.html#a11443093
> 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
>

-------------------------------------
This sig is dedicated to the advancement of Nuclear Power
Tommy Nordgren
tommy.nordgren@comhem.se




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