Configuration conf=new Configuration();
//以下部分设置参数(服务器,端号,用户名,密码,发送邮件帐号,回复邮箱帐号)
conf.Fields[CdoConfiguration.cdoSendUsingMethod].Value=CdoSendUsing.cdoSendUsingPort;
conf.Fields[CdoConfiguration.cdoSMTPServer].Value="smtp.21cn.com";
conf.Fields[CdoConfiguration.cdoSMTPServerPort].Value=25;
conf.Fields[CdoConfiguration.cdoSMTPAccountName].Value="greystar@21cn.com";
conf.Fields[CdoConfiguration.cdoSendUserReplyEmailAddress].Value="\"greystar\" ";
conf.Fields[CdoConfiguration.cdoSendEmailAddress].Value="\"greystar\" ";
conf.Fields[CdoConfiguration.cdoSMTPAuthenticate].Value=CdoProtocolsAuthentication.cdoBasic;
conf.Fields[CdoConfiguration.cdoSendUserName].Value="greystar@21cn.com";
conf.Fields[CdoConfiguration.cdoSendPassword].Value="XXXXXXX";
conf.Fields.Update();
MessageClass msg=new MessageClass();
msg.Configuration=conf;
msg.To="greystar@21cn.com";
msg.Subject= "注册确认通知";
msg.HTMLBody="注册信息"
msg.From="greystar@21cn.com";
msg.Send();