Email with ASP.NET

xiaoxiao2021-04-01  230

using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls Using system.Web.ui.htmlcontrols; using system.web.mail;

namespace PWDGet {///

/// Summary description for passwordGet /// public class passwordGet: System.Web.UI.Page {protected System.Web.UI.WebControls.Panel PanelError; protected System. .Web.UI.WebControls.Panel panelMessage; private void Page_Load (object sender, System.EventArgs e) {if (! this.IsPostBack) {try {// send Email code MailMessage Mail = new MailMessage ();

Mail.from = strfromman; mail.to = startoman;

Mail.subject = "ASC Wines Password Assistance";

Mail.Body = " message "; mail.bodyformat = mailformat.html; mail.fields.add ("http://schemas.microsoft.com/ CDO / Configuration / SMTPAUTHENTICATE "," 1 "); mail.fields.add (" http://schemas.microsoft.com/cdo/configuration/sendusername "," test "); // Here you fill in the username of your mailbox Mail.fields.add ("http://schemas.microsoft.com/cdo/configuration/sendpassword", "ssbgroup"); // your mailbox password

SMTPMAIL.SMTPSERVER = "mail.ssbg.com.cn"; // Mail Server SMTPMAIL.SEND (MAIL);

//Response.write ("succeed! ... ");} catch {this.panelaror.visible = true; this.PanelMessage.Visible = false;}}}

#Region Web Form Designer generated code override protected void oninit (Eventargs e) {//// Codegen: this call is required by the asp.net web form designer. // initializecomponent (); base.onit (e);} / //

/// Required method for Designer support -. do not modify /// the contents of this method with the code editor /// private void InitializeComponent () {this.Load = new System .Eventhandler (this.page_load);} #ENDREGON}}

转载请注明原文地址:https://www.9cbs.com/read-131175.html

New Post(0)