首页 > 开发 > 综合 > 正文

通过CDO组件对NNTP服务器发送消息

2024-07-21 02:25:23
字体:
来源:转载
供稿:网友
 

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;
   }


  }
 }

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表