var wshShell = WScript.CreateObject( "WScript.Shell" );

fac_send_mail_html("j.grootlipman@facilitor.nl");
//fac_send_mail_html("glipman@home.nl");
//fac_send_mail_html("helpdesk@facilitor.nl");

function fac_send_mail_html(adrTo,strSubj,strBody)
{
    strSubj = "ORA-errors in TestOracle " + new Date();
    strBody = "ORA-errors in TestOracle\n<code>" ;
    while (!WScript.StdIn.AtEndOfStream)
    {
        strBody = strBody + WScript.StdIn.ReadAll();
    }
    strBody += "\n</code>";
    strBody = strBody.replace(/\n/g, "\n<br>")
    var objMail;

    var sch = "http://schemas.microsoft.com/cdo/configuration/"

    var iConf =  new ActiveXObject("CDO.Configuration")
    iConf.Fields(sch+"sendusing") = 2;
    iConf.Fields(sch+"smtpserver") = "emmex11.ad.aareon.com";
    iConf.Fields(sch+"smtpserverport") = 25;
    iConf.Fields(sch+"smtpauthenticate") = 0; // anoniem
    iConf.Fields.Update();

    // create mail service object
    objMail = new ActiveXObject("CDO.Message");
    objMail.Configuration = iConf

    //var objAttachment = objMail.AddAttachment("diffwork_33.lst");
    //objAttachment.ContentTransferEncoding = "base64";


    objMail.To = adrTo;
    objMail.From = "oracletest@oracletest.facilitor.nl";
    objMail.Subject = strSubj;
    objMail.HtmlBody = strBody;

    objMail.Send();
}
