ÓÃasp.net·¢ËÍÓʼþ£¬²âÊԳɹ¦
//Ò»£ºÓÃ×Ô¼ºµÄ·þÎñÆ÷×÷ΪÓʼþ·þÎñÆ÷ʱ£º
//Èç³öÏÖ£ºÓÊÏä²»¿ÉÓᣠ·þÎñÆ÷ÏìӦΪ: 5.7.1 Unable to relay for ***@gmail.com
//½â¾ö°ì·¨ÈçÏ£ºÔÚIISÖУ¬ÓÒ»÷“ĬÈÏSMTPÐéÄâ·þÎñÆ÷”£¬Ñ¡Ôñ“ÊôÐÔ”£¬Çл»µ½“·ÃÎʔҳ£¬µã»÷“Öм̔°´Å¥£¬ÔÚµ¯³ö¿òÖÐÑ¡Ôñ“½öÒÔÏÂÁбí³ýÍ┣¬È·¶¨¡£
//¶þ£ºÓÃÆäËüµÄÓʼþ·þÎñÆ÷·¢ËÍ£¬¾²âÊÔ´ó¶àÊýÃâ·ÑÓÊÏ䶼²»ÌṩSMTP·þÎñ£¬ÓÃqqÓÊÏäµÄ¾Í¿ÉÒÔ£¬·½·¨£º½øÈëqqÓÊÏ䣣£¾ÉèÖ㣣¾ÕÊ»§£££¾¿ªÍ¨POP3/IMAP/SMTP·þÎñ£¬¼´¿ÉÓÃsmtp.qq.com×÷ΪÓʼþ·þÎñÆ÷ÁË£¬¿ÉÓÃËüÀ´·¢ËÍÓʼþ
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void SendSMTPEMail(string strSmtpServer, string strfrom, string strfromPass, string strto, string strSubject, string strBody)
{
System.Net.Mail.SmtpClient client = new SmtpClient(strSmtpServer);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(strfrom, strfromPass);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
System.Net.Mail.MailMessage message = new MailMessage(strfrom, strto, strSubject, strBody);
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = true;
client.Send(message);
}
//µÚÒ»¸ö²ÎÊýÊÇÓÊÏä·þÎ
Ïà¹ØÎĵµ£º
Ò»¡¢Response¶ÔÏó
Response¶ÔÏóÊÇHttpResponseÀàµÄÒ»¸öʵÀý¡£¸ÃÀàÖ÷ÒªÊÇ·â×°À´×ÔASP.NET²Ù×÷µÄHTTPÏìÓ¦ÐÅÏ¢¡£
1.Response¶ÔÏóµÄÊôÐÔ
¢Ù BufferOutput
˵Ã÷£º»ñÈ¡»òÉèÖÃÒ»¸öÖµ£¬¸ÃֵָʾÊÇ·ñ»º³åÊä³ö£¬²¢ÔÚÍê³É´¦ÀíÕû¸öÒ³Ö®ºó½«Æä·¢ËÍ
ÊôÐÔÖµ£ºÈç¹û»º³åÁ˵½¿Í»§¶ËµÄÊä³ö£¬ ......
netÖÐC#´úÂëÓëjavaScriptº¯ÊýµÄÏ໥µ÷ÓÃÎÊÌâ¡£
¡¡¡¡ÎÊ£º
¡¡¡¡1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
¡¡¡¡2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
¡¡¡¡3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
¡¡¡¡4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
¡¡¡¡ÎÊÌâ1´ð°¸ÈçÏ£º
¡¡¡¡javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
¡¡¡¡·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò ......
×î½üÏë°Ñ×öµÄASP.NETÍøÕ¾ÅäÖõ½IIS£¬ÊµÏÖÔÚ¾ÖÓòÍøÖзÃÎÊ¡£ÔÚÍøÕ¾ÉÏÕÒÁËЩ×ÊÁÏ£¬×Ô¼ºÑо¿ÁËÏ£¬ÏÖ°ÑһЩ¾ßÌå²½Öè¼°ÎÊÌâ·ÖÏí³öÀ´£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
Ò»¡¢ÅäÖÃIIS
1¡¢"³ÌÐò"->"ÉèÖÃ"->"¿ØÖÆÃæ°å"->"¹ÜÀí¹¤¾ß"->Ñ¡Ôñ"Internet Ð ......
html֪ʶ£¬Request.Form
½ÓÊÕµÄÊÇNameÖµ£¬¶ø·ÇIDÖµ
ÈôÊÇÓÃaspxÒ³ÃæÈ¡Öµ£¬±íµ¥ÖеÄrunat="server"Ҫȥµô¡£
asp.net֪ʶ£¬asp.netµÄ¿Ø¼þµÄIDºÍNameÖµÊÇÒ»ÑùµÚ£¬µ«ÊÇÆäÔÚ¿Í»§¶Ë±íÏÖÊÇcontrol.clientID¶ø·Ç
control.ID
asp.net±¾ÉíÒ²ÊÇ¿ÉÒÔ¿çÒ³Ìá½»µÎ£¬Èç¹ûÊÇʹÓÃ×Ô¼º´øµÄ¿çÒ³Ìá½»¾Í²»´æÔÚÉÏÊöÎÊÌ⣬²»¹ýas ......
protected void btncancel_Click(object sender, EventArgs e)
{
Page.RegisterStartupScript("", "<mce:script type="text/javascript"><!--
window.close()
// --></mce:script>");
}
......