I want to send a e-mail with jsx.
I got a sample script , and be able to send a e-mail .
But , I have some question.
1.Japanese character changed to "?". Can I get the non-converted characters?
2.I want to send as "CC" too. I can send for two or more addresses . But It is not "CC". Is there a suitable command?
3."To:" field make addresses to "undisclosed-recipients". How to show the addresses?
| sample Script |
|---|
// ↓ Server // To:
// ↓To:
// ↓ Text |
Thank you.
Nakamori
It looks like you would need to send the text uuencoded then decode the recieved email, this might help...
http://www.webtoolkit.info/javascript-base64.html
You could see if this might help with the fields...
// ↓ Server
var mailServer = "ooo.xxx.co.jp";
// To:
mailAddress = "emailAddress1";
mailAddress2 = "EmailAddress2";
// Subject:
var mailTitle = "test";
// Text:
var mailText = "e-mail test\r\ntest\r\nあいうえお"; //Japanese is contained
printText = true;
// function >>sendmail
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";
// ↓From:
sObj.writeln("MAIL From: xxx@xxx.co.jp")
txt += sObj.read()+"\n";
// ↓To:
sObj.writeln("RCPT To: "+mailAddress);
sObj.writeln("RCPT To: "+mailAddress2);
txt += sObj.read()+"\n";
sObj.writeln("DATA");
sObj.writeln("From: "+mailAddress2);
sObj.writeln("To: "+mailAddress);
sObj.writeln("Cc: "+mailAddress2);
// ↓ Subject:
sObj.writeln("Subject: "+mailTitle);
txt += sObj.read()+"\n";
// ↓ Text
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();
}
}
North America
Europe, Middle East and Africa
Asia Pacific