楼上的理解错了 楼主的意思是服务器SMTP发送的时候使用SSL 这和WEB程序没有关系
public void ProcessRequest(HttpContext context)
{
string address = context.Request.QueryString["address"];
string subject = context.Request.QueryString["subject"];
string body = context.Request.QueryString["body"];
SmtpClient client = new SmtpClient("smtp.sina.com");
client.Port = 25;
client.Credentials = new NetworkCredential("username@sina.com",
"password");
MailAddress from = new MailAddress("username@sina.com");
MailAddress to = new MailAddress(address);
MailMessage message = new MailMessage(from, to);
message.Body = body;
//message.BodyEncoding = System.Text.Encoding.UTF8;
message.Subject = subject;
//message.SubjectEncoding = System.Text.Encoding.UTF8;
client.Send(message);
message.Dispose();
context.Response.ContentType = "text/html";
context.Response.Write("Message sent!");
}
--
修改:sanfei FROM 183.14.16.*
FROM 113.116.77.*
附件(23.7KB) phpmailer.rar