I was wondering if there is an Email module for MS Jscript (not Jscript .net) similar to the one in python?
+1
A:
You can use the Collaboration Data Objects (CDO) COM API.
Here's how you can send a text e-mail using CDO:
SendEMail("[email protected]", "[email protected]", "Subject", "Text body");
function SendEMail(from, to, subject, body)
{
try
{
var oMsg = new ActiveXObject("CDO.Message");
oMsg.From = from;
oMsg.To = to;
oMsg.Subject = subject;
oMsg.TextBody = body;
oMsg.Send();
}
catch(e)
{
WScript.Echo("Error: " + e.description);
}
}
This page provides some more CDO usage examples (they're in VBScript, but should help you get the idea). See also the CDO Reference at MSDN.
Helen
2009-07-15 06:58:26
Cheers, I've had a look and managed to send an email via gmail :)
PCBEEF
2009-07-16 00:52:19
Glad to help :)
Helen
2009-07-16 06:42:26