MailMessage message = new MailMessage(new MailAddress(“aaaa@qq.com”), new MailAddress(“bbbb@qq.com”));
message.Subject = “测试”;
message.Body = “这是测试文件”;
message.BodyEncoding = System.Text.Encoding.UTF8;
message.IsBodyHtml = false;
SmtpClient mailClient = new SmtpClient(“smtp.qq.com”);
mailClient.EnableSsl = true;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = new NetworkCredential(“aaaa@qq.com”, “*****”);
mailClient.Send(message);
这个就是代码
但是老是报出这个错误:
服务器响应为: mail from address must be same as authorization user
本人QQ邮箱的SMTP设置了,独立密码也弄了就是不知道错误出在哪里,求高手帮主,本人快看花了。
解决方案
20
服务器响应为: mail from address must be same as authorization user
这个错误很明显
提示你,发送邮件的账号密码不正确或不存在,没有授权
这个错误很明显
提示你,发送邮件的账号密码不正确或不存在,没有授权