Author: yumani
Date: Tue Jan 8 23:00:51 2008
New Revision: 12000
Log:
added the file.
Added:
trunk/commons/qa/mashup/Service Scripts/EmailToGmail.js
Added: trunk/commons/qa/mashup/Service Scripts/EmailToGmail.js
==============================================================================
--- (empty file)
+++ trunk/commons/qa/mashup/Service Scripts/EmailToGmail.js Tue Jan 8
23:00:51 2008
@@ -0,0 +1,163 @@
+
+// Sending an email from an gmail account.
+function sendEmail(){
+
+var message = new Email();
+
+message.from = "[EMAIL PROTECTED]";
+message.to = "[EMAIL PROTECTED]"; // alternatively message.to can be a array
of strings. Same goes for cc bcc
+message.cc = "[EMAIL PROTECTED]";
+message.bcc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement("temp.txt"); // this method has a variable number of
arguments. each argument can be a File hostObject or a string representing a
file.
+message.text = "This is a mail sent from sendMail() function. The 1.0 release
is planned for end of january";
+message.send();
+}
+
+
+
+function sendEmail_HostUserPass(){
+
+var message = new Email("smtp.gmail.com", "[EMAIL PROTECTED]", "wso2wsas"); //
Default port is used unless specified in the server.xml
+
+var file = new File("temp.txt");
+message.from = "[EMAIL PROTECTED]";
+message.to = "[EMAIL PROTECTED]"; // alternatively message.to can be a array
of strings. Same goes for cc bcc
+message.cc = "[EMAIL PROTECTED]";
+message.bcc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement(file); // this method has a variable number of
arguments. each argument can be a File hostObject or a string representing a
file.
+message.text = "This is a mail sent from sendEmail_HostUserPass() function.
The 1.0 release is planned for end of january";
+message.send();
+}
+
+
+function sendEmail_HostPortUserPass(){
+
+var message = new Email("smtp.gmail.com", "25", "[EMAIL PROTECTED]",
"wso2wsas");
+
+
+message.from = "[EMAIL PROTECTED]";
+message.to = "[EMAIL PROTECTED]"; // alternatively message.to can be a array
of strings. Same goes for cc bcc
+message.cc = "[EMAIL PROTECTED]";
+message.bcc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement("temp.txt"); // this method has a variable number of
arguments. each argument can be a File hostObject or a string representing a
file.
+message.text = "This is a mail sent from sendEmail_HostPortUserPass()
function. The 1.0 release is planned for end of january";
+message.send();
+
+}
+
+//************************************************************************************************
+//Sending a .jpg as an attachement
+//************************************************************************************************
+
+function sendEmailwithJPG(){
+
+var message = new Email();
+
+message.from = "[EMAIL PROTECTED]";
+message.to = "[EMAIL PROTECTED]"; // alternatively message.to can be a array
of strings. Same goes for cc bcc
+message.cc = "[EMAIL PROTECTED]";
+message.bcc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement("text.jpg"); // this method has a variable number of
arguments. each argument can be a File hostObject or a string representing a
file.
+message.text = "This is a mail sent from sendMail() function. The 1.0 release
is planned for end of january";
+message.send();
+}
+
+
+//************************************************************************************************
+//Sending two attachements
+//************************************************************************************************
+
+function sendEmailwithManyFiles(){
+
+var message = new Email();
+
+message.from = "[EMAIL PROTECTED]";
+message.to = "[EMAIL PROTECTED]"; // alternatively message.to can be a array
of strings. Same goes for cc bcc
+message.cc = "[EMAIL PROTECTED]";
+message.bcc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement("text.jpg","temp.txt"); // this method has a variable
number of arguments. each argument can be a File hostObject or a string
representing a file.
+message.text = "This is a mail sent from sendMail() function. The 1.0 release
is planned for end of january";
+message.send();
+}
+
+
+//*************************************************************************************************
+//Send to Array of TO
+//*************************************************************************************************
+function sendEmail_ArrayOfTo(){
+// Create a new Email hostObject
+var message = new Email("smtp.gmail.com", "25", "[EMAIL PROTECTED]",
"wso2wsas");
+var file = new File("temp.txt");
+message.from = "[EMAIL PROTECTED]";
+
+//Having an array of addresses as "To"
+var to = new Array();
+to[0] = "[EMAIL PROTECTED]";
+to[1] = "[EMAIL PROTECTED]";
+to[2] = "[EMAIL PROTECTED]";
+message.to = to;
+
+//message.to = "[EMAIL PROTECTED]";
+message.cc = "[EMAIL PROTECTED]";
+message.bcc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement(file); // this method has a variable number of
arguments. each argument can be a File hostObject or a string representing a
file.
+message.text = "This is a mail sent from sendEmail_ArrayOfTo() function. The
1.0 release is planned for end of January";
+message.send();
+}
+
+//*************************************************************************************************
+//Send to Array of CC
+//*************************************************************************************************
+function sendEmail_ArrayOfCC(){
+// Create a new Email hostObject
+var message = new Email("smtp.gmail.com", "25", "[EMAIL PROTECTED]",
"wso2wsas");
+var file = new File("temp.txt");
+message.from = "[EMAIL PROTECTED]";
+
+//Having an array of addresses as "To"
+var cc = new Array();
+cc[0] = "[EMAIL PROTECTED]";
+cc[1] = "[EMAIL PROTECTED]";
+cc[2] = "[EMAIL PROTECTED]";
+message.cc = cc;
+
+//message.to = "[EMAIL PROTECTED]";
+message.to = "[EMAIL PROTECTED]";
+message.bcc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement(file); // this method has a variable number of
arguments. each argument can be a File hostObject or a string representing a
file.
+message.text = "This is a mail sent from sendEmail_ArrayOfTo() function. The
1.0 release is planned for end of January";
+message.send();
+}
+
+
+//*************************************************************************************************
+//Send to Array of BCC
+//*************************************************************************************************
+function sendEmail_ArrayOfBCC(){
+// Create a new Email hostObject
+var message = new Email("smtp.gmail.com", "25", "[EMAIL PROTECTED]",
"wso2wsas");
+var file = new File("temp.txt");
+message.from = "[EMAIL PROTECTED]";
+
+//Having an array of addresses as "To"
+var bcc = new Array();
+bcc[0] = "[EMAIL PROTECTED]";
+bcc[1] = "[EMAIL PROTECTED]";
+bcc[2] = "[EMAIL PROTECTED]";
+message.bcc = bcc;
+
+//message.to = "[EMAIL PROTECTED]";
+message.to = "[EMAIL PROTECTED]";
+message.cc = "[EMAIL PROTECTED]";
+message.subject = "Mashup server approaches 1.0";
+message.addAttachement(file); // this method has a variable number of
arguments. each argument can be a File hostObject or a string representing a
file.
+message.text = "This is a mail sent from sendEmail_ArrayOfTo() function. The
1.0 release is planned for end of January";
+message.send();
+}
_______________________________________________
Commons-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev