/* * 发送按钮点击事件 */ private void sendBtn_Click(object sender, EventArgs e) { if (checkNull() == false) { return; } MailManager mailManager = new MailManager(); setEmailInfo(mailManager); mailManager.send(); }
private void setEmailInfo(MailManager mailManager) { mailManager.setEmailTo(this.emailAddress.Text); mailManager.setEmailTitle(this.emailTitle.Text); mailManager.setEmailBody(this.emailBody.Text); mailManager.setEmailEncoding(); mailManager.setEmailPriority(); mailManager.setEmailFrom(this.sendUsername); mailManager.setPassword(this.sendPassword); if (this.attachmentLocation.Text != "") { mailManager.setEmailAttachment(this.attachmentLocation.Text); } }