Sending messages to the NNTP server through the CDO component

Source: Internet
Author: User
Tags dotnet nntp nntp server
Server

Class cdosend{
public void Sendmessagebox () {
try {
Cdos. Message omsg = new CDO. Message ();
Cdos. Nntppostconnectorclass p=new CDO. Nntppostconnectorclass ();

oMsg.From = "Xxx@xxx.xxx"
oMsg.To = "Xxx@xxx.xxx"

oMsg.Subject = "Newtest";

Omsg.textbody = "Huhong test";
Omsg.newsgroups= "Microsoft.public.cn.dotnet.framework";


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


}
}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.