需要顯示MODALPOPUP擴展器,同時點擊鏈接按鈕和模態彈出擴展器,我們需要發送電子郵件到所需的郵件ID持有人。需要顯示MODALPOPUP擴展器,同時點擊鏈接按鈕
是否有任何規格和功能在C#中使用ASP.NET,請給我最好的建議。
在此先感謝
需要顯示MODALPOPUP擴展器,同時點擊鏈接按鈕和模態彈出擴展器,我們需要發送電子郵件到所需的郵件ID持有人。需要顯示MODALPOPUP擴展器,同時點擊鏈接按鈕
是否有任何規格和功能在C#中使用ASP.NET,請給我最好的建議。
在此先感謝
首先加下面提到的代碼命名空間距離要發送郵件aspx頁面的後面。
using System.Net.Mail;
protected void Button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To.Add("Email ID where email is to be send");
mail.To.Add("Another Email ID where you wanna send same email");
mail.From = new MailAddress("[email protected]");
mail.Subject = "Email using Gmail";
string Body = "Hi, this mail is to test sending mail"+
"using Gmail in ASP.NET";
mail.Body = Body;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("[email protected]","YourGmailPassword");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
}
發送郵件的嘗試在C#
打開上面的代碼上按鈕的Modalpopup擴展單擊
<div id="hiddenDiv" style="display:none; visibility:hidden;">
<asp:Button runat="server" ID="hiddenButton" />
/div>
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderID" runat="server"
BehaviorID="ModalPopupBehaviorID"
TargetControlID="hiddenButton"
PopupControlID="ModalContainer"
/>
...
//Javascript
var modalPopupBehaviorCtrl = $find('ModalPopupBehaviorID');
modalPopupBehaviorCtrl.show();
你有什麼話想做到這一點???你的問題關注發送電子郵件或開放madalpopup ...在asp.net發送電子郵件有很多問題..爲更好的回答寫正確的問題.. – 2012-02-04 07:11:40