Distinct offers Network Monitor, the ONLY natural language Protocol Analyzer, ONC RPC for C++, .NET and Java, and IntelliTerm, the fastest Terminal Emulator for TN3270, TN5250 and VT420 on the market.

Knowledge Base

   Products   Downloads   Sales   Support   About us
  Knowledge Base  Ask Cody  Manuals  Source Code Library  Resources
 



        
 
How do I use this from Java
 
Product: Distinct Mail ObjectsTopic: SMTP componentLast updated: 3/10/2008
 
Q.: How do I use this from Java
A.: 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);

}
}

Do you find this information useful ?       Yes   No   Not Sure




Search by Keyword


If you did not find what you are looking for:


Products

 Packet Analyzer
The Distinct Network Monitor is a protocol analyzer for Windows that includes both packet sniffing and network traffic statistical analysis tools.

 Intelliterm
The Most Complete Terminal Emulator for TN3270, TN5250 and DEC VT220 to VT420

 RPC for C and C++
The Fastest Way to Port Your Existing Unix-RPC Applications to Windows

  9/2/2010   Legal notices | PRIVACY Policy |