winform发邮件失败(asp.net中可以成功)
由于特殊原因把asp.net上的一段发邮件的代码放到winform中但却报错说未指定Smtp主机这是我的代码 有知道马上告诉我,我马上结分
MailAddress M_From = new MailAddress("information@ebuyjp.com","information@ebuyjp.com");
MailAddress M_To = new MailAddress("Beckham6230@hotmail.com", "Beckham6230@hotmail.com");
MailMessage Mail = new MailMessage(M_From, M_To);
Mail.Subject = "kaka";
Mail.Body = "ssssssss";
Mail.BodyEncoding = System.Text.Encoding.UTF8;
Mail.SubjectEncoding = System.Text.Encoding.UTF8;
Mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
//smtp.UseDefaultCredentials = true;
smtp.Credentials = new System.Net.NetworkCredential("information@ebuyjp.com", "ppppp");
smtp.Send(Mail);
--------------------编程问答-------------------- 楼主没有连接到远程SMTP 主机上的TCP 端口25 ?
--------------------编程问答-------------------- 因为发邮件不是我做的我只负者调用,不太了解发邮件的设置,我在asp.net中已经发送成功了,在winform中同样的代码却不行,麻烦能帮我解决下,楼上说的那些我都不太明白
补充:.NET技术 , ASP.NET