使用MailMessage和SmtpClient发送邮件失败,错误信息:"邮箱不可用。 服务器响应为: Óû§±»Ëø&
结果如标题
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;
using System.Net;
namespace SendMailButton
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage( "test.0000@163.com ", "test.0000@163.com ");
mail.Body = "22222 ";
mail.Subject = "111111 ";
mail.Priority = MailPriority.High;
mail.BodyEncoding = Encoding.UTF8;
SmtpClient client = new SmtpClient( "smtp.163.com ");
client.UseDefaultCredentials = false;
client.DeliveryMethod=SmtpDeliveryMethod.Network;
client.Credentials = new NetworkCredential( "test.0000@163.com ", "test0000 ");
client.Send(mail);
MessageBox.Show( "发送成功! ");
}
}
}
请各位高手指点!!!!!!
------解决方案--------------------坐着沙发等高手来解答
应该是邮件服务器出错了...楼主好像没写到邮箱密码之类的