SoftMail 类 |
命名空间: HslCommunication.BasicFramework
SoftMail 类型公开以下成员。
名称 | 说明 | |
---|---|---|
MailSendAddress |
邮件发送的地址
|
名称 | 说明 | |
---|---|---|
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) | |
GetHashCode | Serves as the default hash function. (继承自 Object。) | |
GetType | Gets the Type of the current instance. (继承自 Object。) | |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) | |
SendMail(Exception) |
发生BUG至邮件地址,需要提前指定发送地址,否则失败
| |
SendMail(Exception, String) |
发生BUG至邮件地址,需要提前指定发送地址,否则失败
| |
SendMail(String, String) |
发送邮件至地址,需要提前指定发送地址,否则失败
| |
SendMail(String, String, Boolean) |
发送邮件至地址,需要提前指定发送地址,否则失败
| |
SendMail(String, String, String) |
发送邮件的方法,需要指定接收地址,主题及内容
| |
SendMail(String, String, String, Boolean) |
发送邮件的方法,默认发送别名,优先级,是否HTML
| |
SendMail(String, String, String, String, String, MailPriority, Boolean) |
发送邮件的方法,需要提供完整的参数信息
| |
ToString | Returns a string that represents the current object. (继承自 Object。) |
名称 | 说明 | |
---|---|---|
MailSystem163 |
系统提供一个默认的163邮箱发送账号,只要更改接收地址即可发送服务,可能会被拦截
| |
MailSystemQQ |
系统提供一个默认的QQ邮箱发送账号,只要更改接收地址即可发送服务,发送成功概率比较高
|
名称 | 说明 | |
---|---|---|
ToJsonString |
获取当前对象的JSON格式表示的字符串。 (由 HslExtension 定义。)Gets the string represented by the JSON format of the current object. |
public partial class FormMail : HslFormContent { public FormMail( ) { InitializeComponent( ); } private void FormMail_Load( object sender, EventArgs e ) { textBox3.Text = "<html><body style=\"background-color:PowderBlue;\"><h1>Look! Styles and colors</h1><p style=\"font-family:verdana;color:red\">This text is in Verdana and red</p><p style=\"font-family:times;color:green\">This text is in Times and green</p><p style=\"font-size:30px\">This text is 30 pixels high</p></body></html> "; Language( Program.Language ); } private void Language( int language ) { if (language == 1) { Text = "邮件发送测试"; label7.Text = "发送地址:"; label9.Text = "主题:"; label1.Text = "内容:(字符串)"; textBox1.Text = "测试主题"; textBox4.Text = "测试内容"; button3.Text = "发送"; label8.Text = "发送地址:"; label6.Text = "主题:"; label3.Text = "内容:(html)"; textBox2.Text = "测试主题"; button1.Text = "发送"; } else { Text = "Mail Send Test"; label7.Text = "Address:"; label9.Text = "Subject:"; label1.Text = "String Content:"; textBox1.Text = "Test Subject"; textBox4.Text = "Test Content"; button3.Text = "Send"; label8.Text = "Address:"; label6.Text = "Subject:"; label3.Text = "Html Content:"; textBox2.Text = "Test Subject"; button1.Text = "Send"; } } private void button3_Click( object sender, EventArgs e ) { // 发送普通的文本 try { // SoftMail.MailSystem163.SendMail( "[你的邮件地址]", "[这是主题]", "[这是内容]" ); SoftMail.MailSystem163.SendMail( textBox5.Text, textBox1.Text, textBox4.Text ); MessageBox.Show( "发送成功!" ); } catch (Exception ex) { SoftBasic.ShowExceptionMessage( ex ); } } private void button1_Click( object sender, EventArgs e ) { // 发送html文本 try { // SoftMail.MailSystem163.SendMail( "[你的邮件地址]", "[这是主题]", "[上面的html内容]",true ); SoftMail.MailSystem163.SendMail( textBox6.Text, textBox2.Text, textBox3.Text, true ); MessageBox.Show( "发送成功!" ); } catch (Exception ex) { SoftBasic.ShowExceptionMessage( ex ); } } }