关于邮件传递系统

编程入门 行业动态 更新时间:2024-10-15 10:16:18
本文介绍了关于邮件传递系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

实际上,我会在文本框中输入邮件ID,但不会发送.我不知道为什么未发送.任何机构都可以帮助我

actually i will give mail id in my text box but its not sending.i don''t know why its not sended.can any body help me

try { //textbox3.text is we can give mail id in that MailAddress mailfrom = new MailAddress("TextBox3.Text"); MailAddress mailto = new MailAddress("sankarreddyece@gmail"); MailMessage newmsg = new MailMessage(mailfrom, mailto); newmsg.Subject = "Subject of Email"; newmsg.Body = "Body(message) of email"; ////For File Attachment, more file can also be attached //Attachment att = new Attachment ( "G:\\code.txt" ); //newmsg.Attachments.Add ( att ); SmtpClient smtps = new SmtpClient("smtp.gmail", 587); smtps.UseDefaultCredentials = false; smtps.Credentials = new System.Net.NetworkCredential("sankarreddyece@gmail", "640"); smtps.EnableSsl = true; smtps.Send(newmsg); //MessageBox.Show("mail Send"); } catch (Exception ex) { //MessageBox.Show(ex.ToString()); }

推荐答案

好吧,这是VS2010附带的这个工具-称为调试器.如果使用它,您将发现异常.顺便说一句,您在catch块中注释掉的代码应为: Well, there;''s this tool that comes with VS2010 - it''s called a debugger. If you use it, you''ll discover the exception. And by the way, the code you have commented out in your catch block should be this: MessageBox.Show(ex.Message);

更多推荐

关于邮件传递系统

本文发布于:2023-11-25 10:43:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1629440.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮件   系统

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!