Code: Select allvar mailServer = "mail_Server_name";
var mailAddress = "E-Mail-Address";
var mailTitle = "Results of script";
var mailText = "Script completed at " + new Date();
printText = false; //True print results to Console.
sendmail(mailServer, mailAddress,mailTitle,mailText);
function sendmail(mailServer, mailAddress,mailTitle,mailText){
var sObj = new Socket();
if (sObj.open(mailServer+":25")) {
sObj.writeln("HELO "+mailServer);
var txt = sObj.read()+"\n";
sObj.writeln("MAIL From: " + mailAddress);
txt += sObj.read()+"\n";
sObj.writeln("RCPT To: "+mailAddress);
txt += sObj.read()+"\n";
sObj.writeln("DATA");
sObj.writeln("From: Photoshop");
txt += sObj.read()+"\n";
sObj.writeln("To: "+mailAddress);
txt += sObj.read()+"\n";
sObj.writeln("Subject: "+mailTitle);
txt += sObj.read()+"\n";
sObj.writeln(mailText);
txt += sObj.read()+"\n";
sObj.writeln(".");
txt += sObj.read()+"\n";
sObj.writeln("QUIT");
txt += sObj.read()+"\n";
if(printText) $.writeln(txt);
sObj.close();
}
}
Send Mail from Script
Send Mail from Script
I'm really curious about this script. What is the correct syntax for the "mail server" and "mail address" strings?
Send Mail from Script
You might want to check out the EMailer panel on Russell Brown's web site. It handles the back end email details and has an option to resize before emailing.