
10.03.2013, 01:00
|
|
Новичок
Регистрация: 10.03.2013
Сообщений: 1
С нами:
6934646
Репутация:
0
|
|
function SendMail(sRecipientMail, sSubject, sMsgBody,files)
{
try
{
// create a session and log on -- username and password in profile
var refMsg = WScript.CreateObject("CDO.Message");
var refConf = WScript.CreateObject("CDO.Configuration");
// Setting configuration params
with(refConf.Fields)
{
Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "www.mysmtp.com";
Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2;
}
refConf.Fields.Update();
with(refMsg)
{
Configuration = refConf;
To = sRecipientMail;
From = "billgates@microsoft.com";
Subject = sSubject;
TextBody = sMsgBody;
}
if (files)
{
for(var i=0; i<files.length; i++)
refMsg.AddAttachment(files[i]);
}
refMsg.Send();
}
catch(e)
{
WScript.Echo("SendMail error: " + e.description);
WScript.Quit(1);
}
}
|
|
|