コード例 #1
0
ファイル: MailConfigadd.cs プロジェクト: huaminglee/myyyyshop
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Maticsoft.Model.MailConfig model = new Maticsoft.Model.MailConfig {
         Mailaddress = this.txtMailaddress.Text,
         Password = this.txtPassword.Text,
         POPPort = Convert.ToInt32(this.txtPOPPort.Text),
         POPServer = this.txtPOPServer.Text,
         POPSSL = this.chkPOPSSL.Checked,
         SMTPPort = Convert.ToInt32(this.txtSMTPPort.Text),
         SMTPServer = this.txtSMTPServer.Text,
         SMTPSSL = this.chkSMTPSSL.Checked,
         Username = this.txtUsername.Text
     };
     if (base.CurrentUser != null)
     {
         model.UserID = base.CurrentUser.UserID;
     }
     Maticsoft.BLL.MailConfig config2 = new Maticsoft.BLL.MailConfig();
     if (!config2.Exists(model.UserID, model.Mailaddress))
     {
         config2.Add(model);
         base.Response.Redirect("mailconfiglist.aspx");
     }
     else
     {
         this.lblInfo.Visible = true;
         this.lblInfo.Text = "This account already exists";
     }
 }
コード例 #2
0
ファイル: Modify.cs プロジェクト: huaminglee/myyyyshop
 private void SendEmail(string email)
 {
     Maticsoft.Model.MailConfig model = new Maticsoft.BLL.MailConfig().GetModel();
     WebSiteSet set = new WebSiteSet(ApplicationKeyType.Shop);
     string webName = set.WebName;
     string str2 = string.Format("您对商品【{0}】的咨询有了新的回复,请及时查看!", webName);
     EmailQueue queue = new EmailQueue {
         EmailTo = model.Mailaddress,
         EmailSubject = string.Format("{0}回复通知", webName),
         EmailFrom = model.Mailaddress,
         EmailBody = str2,
         EmailPriority = 0,
         IsBodyHtml = false,
         NextTryTime = DateTime.Now
     };
     EmailManage.PushQueue(queue);
 }