ASP.NET|SMTP in the. NET Framework 1.1, this requirement has been taken into account, adding a Fields collection to the MailMessage component is easy to increase the issue of sender authentication in the ESMTP mail server. However, this method applies only to the. NET Framework 1.1 and does not apply to the. NET Framework version 1.0. The mail-sending program with sender authentication is as follows:
<%@ Import namespace= "System.Web.Mail"%>
<script runat= "Server" >
MailMessage mail=new MailMessage ();
Mail. From= "service@brookes.com";
Mail. To= "brookes@brookes.com";
Mail. Bodyformat=mailformat.text;
Mail. body= "a test SMTP mail.";
Mail. subject= "Hello."
Mail. Fields.Add ("Http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); Basic Authentication
Mail. Fields.Add ("Http://schemas.microsoft.com/cdo/configuration/sendusername", "Brookes"); Set your username here
Mail. Fields.Add ("Http://schemas.microsoft.com/cdo/configuration/sendpassword", "Walkor"); Set your password here
Smtpmail.smtpserver= "Lsg.moon.net";
Smtpmail.send (mail);
</script>
But this method does not use to Sina's mail, hoped everybody attention