Knowledge Base Ask Cody Resources



 
How do I use this from Java
Here is a code sample for this:


import com.ms.activeX.*;
import com.ms.com.*;

public class Class1
{

public static void main (String[] args)
{
//creating arguments for EasySend
Variant[] margs=new Variant[9];
margs[0]=new Variant("smtp_server"); //substitute your smtp server here
margs[1]=new Variant("john@server.com"); //from address
margs[2]=new Variant("jack@anotherserver.com"); //to address
margs[3]=new Variant(""); //cc field
margs[4]=new Variant(""); //bcc fields
margs[5]=new Variant("test from java"); //message subject
margs[6]=new Variant("message body"); //message body
margs[7]=new Variant(""); //attachment path (empty string means no attachments)
margs[8]=new Variant("c:\\temp"); //temporary folder

//creating SMTP object
ActiveXComponent m=new ActiveXComponent("DCVSMTP.DCVSMTPCtrl.1");
//invoking EasySend method
m.invoke("EasySend",margs);

}
}





12/26/2024   Legal notices | PRIVACY Policy |