Asp.net implements email sending
1try
2 {
3 CDO. Message MSG = new CDO. Message ();
4 MSG. From = "YY@sohu.com ";
5 MSG. To = "XX@sohu.com ";
6 MSG. Subject = "topic ";
7 msg. htmlbody = "<HTML> <body>" + "content"
8 + "</body> 9 CDO. iconfiguration Config = msg. configuration;
10 ADODB. Fields ofields = config. fields;
11 ofields ["http://schemas.microsoft.com/cdo/configuration/sendusing"]. value = 2;
12 ofields ["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"]. value = "YY@sohu.com ";
13 ofields ["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"]. value = "YY@sohu.com ";
14 ofields ["http://schemas.microsoft.com/cdo/configuration/sendusername"]. value = "YY ";
15 ofields ["http://schemas.microsoft.com/cdo/configuration/sendpassword"]. value = "password ";
16 ofields ["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"]. value = 1;
17 ofields ["http://schemas.microsoft.com/cdo/configuration/languagecode"]. value = 0x0804;
18 ofields ["http://schemas.microsoft.com/cdo/configuration/smtpserver"]. value = "smtp.sohu.com ";
19 ofields. Update ();
20 msg. bodypart. charset = "gb2312 ";
21 msg. htmlbodypart. charset = "gb2312 ";
22 MSG. Send ();
23 MSG = NULL;
24}
25 catch (exception ERR)
26 {
27 throw err;
28} [FTC = # ee1d24] <font color = Red> </font> [/ft]