MailMessage问题。我这样怎么发不了邮件
MailMessage mail = new MailMessage();
mail.To = "lmh@126.com ";
mail.Bcc = "vodff@126.com ";
mail.From = "vodff@126.com ";
mail.BodyFormat = MailFormat.Text;
mail.Subject = "Subject of this Email " + System.DateTime.Now.ToString();
mail.Body = "Body of this message. ";
SmtpMail.SmtpServer= "smtp.126.com ";
mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ", "1 ");
mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername ", "vodff ");
mail.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword ", "1111 ");
SmtpMail.Send(mail);
这样发不出去。有错误。
什么问题亚?是不是WINDWOS的smtp要设置什么东西?
------解决方案--------------------是使用的1.1吗?
建议你换个别的邮箱试试,不要使用126或163的