Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


Попробуйте так:
Скрытый текст
Код: Выделить весь код
var to = "zzz@mail.ru";
var subj = "включение компьютера";
var text = "компьютер включен";

SendMail(to, subj, text);

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/sendusing") = 2;
			Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.mail.ru";
			Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465;
			Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1;
			Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "zzz@mail.ru";
			Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password";
			Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
		}

		refConf.Fields.Update();

		with(refMsg) {
			Configuration = refConf;
			To = sRecipientMail;
			From = "xxx@mail.ru";
			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);
	}
}

Отправлено: 12:49, 23-01-2017 | #3