18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

How to configure the mailing

Merajul HaqueMerajul Haque Members
edited November -1 in Sahi - Open Source
I want to generate a mail of result after automation is completed using sahi. I did the following steps :

1) Download mail.jar and activation.jar from here (http://www.oracle.com/technetwork/java/index-138643.html).
2) Copy mail.jar and activation.jar into sahi/extlib/mail folder.
3) Add these jars to Sahi’s classpath.


Pls let me know what is the next process & how to do that ?


Thanks

Comments

  • narayannarayan Administrators
    Hi Merajul,

    Please have a look at this section: http://sahi.co.in/w/sending-emails

    Regards,
    Narayan
  • Hi Narayan

    I did the settings as mentioned.

    In XML file I am adding the following and when I tried to run it was running successfully but its not sending any mail.

    <target name="runsendmail">
    <taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="C:\Users\Merajul.Haque\sahi\lib\ant-sahi.jar"/>
    <sahi suite=""C:\Users\Merajul.Haque\sahi\userdata\scripts\sahi.suite"
    browserType="firefox"
    baseurl="http://myregister.staging.causeway.com/Livelink/livelink.exe";
    sahihost="localhost"
    sahiport="9999"
    failureproperty="sahi.failed"
    haltonfailure="false"
    threads="6">
    <report type="html"/>

    <!--<report type="junit" logdir="${userdata.dir}/temp/junit"/>-->
    </sahi>
    <antcall target="failsahi"/>
    <antcall target="sahipass"/>
    </target>

    <target name="failsahi" if="sahi.failed">
    <!--antcall target="stop-web"/-->
    <mail tolist="byounuss@gmail.com"
    from="ID@causeway.com"
    subject="Email subject"
    mailhost="smtp.causeway.com"
    mailport="465"
    ssl="true"

    <message>Sahi build failed</message>
    </mail>
    <fail message="Sahi tests failed!"/>
    </target>

    <target name="sahipass" unless="sahi.failed">
    <!--antcall target="stop-web"/-->
    <mail tolist="ID@causeway.com"
    from="xxx@causeway.com"
    subject="Email subject"
    mailhost="smtp.gmail.com"
    mailport="465"
    ssl="true"

    <message>Sahi build passed</message>
    </mail>
    </target>



    <target name="sendmail">
    <taskdef name="sahi" classname="net.sf.sahi.ant.RunSahiTask" classpath="C:\Users\Merajul.Haque\sahi\lib\ant-sahi.jar"/>
    <sahi suite="C:\Users\Merajul.Haque\sahi\userdata\scripts\sahi.suite"
    browserType="firefox"
    baseurl="http://myregister.staging.causeway.com/Livelink/livelink.exe";
    sahihost="localhost"
    sahiport="9999"
    failureproperty="sahi.failed"
    haltonfailure="false"
    threads="2">
    <report type="html"/>
    <!--<report type="junit" logdir="${userdata.dir}/temp/junit"/>-->
    </sahi>
    <mail
    tolist="Merajul.Haque@causeway.com"
    from="Merajul.Haque@causeway.com"
    subject="Email subject"
    mailhost="smtp.causeway.com"
    mailport="465"
    ssl="true"
    user="Merajul.Haque@causeway.com">
    <message>Example email sent by Ant Mail task.</message>
    </mail>
    </target>

    </project>




    Pls help
Sign In or Register to comment.