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.

Sending an attachment along with sahi email

saurabh.ssaurabh.s Members
edited November -1 in Sahi - Open Source
Hi,

I'm updating the excel file for the results executed through sahi script.

Sahi is doing fine for reading the file & updating the file with the latest result.

I'm also able to send email after the sahi done with the execution.

However i would like to add excel file as an attachment along with the emai for the result.

I'm using Sahi V3.5.

Comments

  • Hi saurabh,
    I'm also able to send email after the sahi done with the execution.
    Would you mind sharing your code?

    Thanks and regards.
  • Hi,
    I'm using the below mention code for sending mails and its working fine. I'm using this function at the end of the script.

    sendEmail("Mail from Sahi", "All izz well");

    function sendEmail($emailSubject, $emailBody)
    {
    var $host = "smtp.bluetie.com";
    var $port = 25;
    var $username = "aeuser_mcubeit";
    var $password = "bluetie";
    var $mailer = new net.sf.sahi.ant.Mailer($host, $port, $username, $password);
    var $from = "aeuser_mcubeit(at)mcubeit.com";
    var $to = "saurabh.s(at)mcubeit.com";
    $mailer.send($from, $to, $emailSubject, $emailBody);
    }
  • Thanks saurabh.
    Did you install anything for this to work??
  • Hi saurabh,

    Did you get any further information about enclosed attachments with email through Sahi script, I also encounter the problem?

    Thanks,
    Fion
Sign In or Register to comment.