邮件未通过gmail发送 [英] mail was not sent through gmail

查看:87
本文介绍了邮件未通过gmail发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

try
            {

                MailAddress mailfrom = new MailAddress("sankarreddyece@gmail.com");
                MailAddress mailto = new MailAddress(TextBox3.Text);
                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.com", 587);
                smtps.UseDefaultCredentials = false;
                smtps.Credentials = new System.Net.NetworkCredential("sankarreddyece@gmail.com", "640");
                smtps.EnableSsl = true;
                smtps.Send(newmsg);
                //MessageBox.Show("mail Send");

            }


我将尝试使用此编码,它不会显示任何错误.电子邮件也不会发送会出现问题的内容.


I will try this coding its does not show any error.email also not sent what will be problem.

推荐答案

^ ]

从ASP.NET发送SMTP邮件,并以C# [ ^ ]

使用C#发送带有或不带有附件的电子邮件:通用例程. [ ^ ]
.NET Mail Composer[^]

Sending SMTP mail from ASP.NET and codebehind as C#[^]

Sending an Email in C# with or without attachments: generic routine.[^]


尝试一下...
电子邮件-aspnet [
Try this...
Email-sending-in-aspnet[^]


这篇关于邮件未通过gmail发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆