- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
writeLetter.cs
资源名称:Email.rar [点击查看]
上传用户:hncsjykj
上传日期:2022-08-09
资源大小:461k
文件大小:2k
源码类别:
Email客户端
开发平台:
C#
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace LYBemail
- {
- public partial class writeLetter : Form
- {
- string smtp;
- string port;
- string userName;
- string pwd;
- public writeLetter()
- {
- InitializeComponent();
- }
- private void btn_sure_Click(object sender, EventArgs e)
- {
- smtp = txt_smtp.Text;
- port = txt_port.Text;
- userName = txt_name.Text;
- pwd = txt_pwd.Text;
- panel_server.Visible = false;
- panel_write.Visible = true;
- }
- private void btn_send_Click(object sender, EventArgs e)
- {
- #region
- //sendSmtp send = new sendSmtp();
- //send.username = userName;
- //send.password = pwd;
- //bool ch = false;
- //if (check.Checked) ch = true;
- //bool ok = false;
- //try
- //{
- // ok = send.Send(smtp, userName, txt_showName.Text, txt_toName.Text, txt_toName.Text, ch, txt_subject.Text, txt_content.Text);
- // if (ok)
- // {
- // MessageBox.Show("发送成功");
- // }
- //}
- //catch (Exception ex)
- //{
- // MessageBox.Show(ex.Message);
- //}
- #endregion
- sendMail lybsend = new sendMail();
- lybsend._smtp = smtp;
- lybsend._port = port;
- lybsend._userName = userName;
- lybsend._pwd = pwd;
- lybsend._fromName = txt_showName.Text;
- lybsend._toName = txt_toName.Text;
- lybsend._subject = txt_subject.Text;
- lybsend._content = txt_content.Text;
- lybsend._isHtml = check.Checked;
- if (lybsend.send())
- {
- MessageBox.Show("ok");
- }
- else
- {
- MessageBox.Show("error");
- }
- }
- }
- }