class cdosend{
  public void sendmessagebox(){
   try { 
    cdo.message omsg = new cdo.message();
    cdo.nntppostconnectorclass p=new cdo.nntppostconnectorclass();
   
    omsg.from = "[email protected]"
    omsg.to = "[email protected]"
    omsg.subject = "newtest";
   
    omsg.textbody = "huhong test";
    omsg.newsgroups="microsoft.public.cn.dotnet.framework";
    cdo.iconfiguration iconfg = omsg.configuration;
    adodb.fields ofields = iconfg.fields;
    ofields["cdonntpserver"].value="microsoft.public.cn.dotnet.framework";
    ofields["cdonntpserverport"].value =119;
    ofields.update();
    omsg.bodypart.charset="gb2312";
    //omsg.htmlbodypart.charset="gb2312"; 
   
    
    omsg.post();
    omsg = null;
   } 
   catch (exception e) {
    throw e;
   }
  }
 }
新闻热点
疑难解答