Asp.net中sendind SMTP电子邮件时出错 [英] Getting Errror while sendind SMTP Email in Asp.net

查看:100
本文介绍了Asp.net中sendind SMTP电子邮件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在asp.net中发送SMTP电子邮件时发生错误。

错误:SendUsing配置值无效。

请帮我解决

Hi,
I am geeting an error while sending SMTP email in asp.net.
Error : The "SendUsing" configuration value is invalid."
Please help me out

推荐答案

您可以在这里发布您的代码,以便我们为您提供帮助。



你可以试试这个,





Can you post your code over here,so that we can help you.

You can try this,


MailMessage mail = new MailMessage();
                mail.To.Add("abc@gmail.com");
                mail.To.Add("xyz@yahoo.com");
                mail.From = new MailAddress("pqr@yahoo.com");
                mail.Subject = "Send email";
 
                string Body = "Here we are testing";
                mail.Body = Body;
                Attachment at = new Attachment("c:\\a.docx");
                mail.Attachments.Add(at);
 
                mail.IsBodyHtml = true;
                
                SmtpClient smtp = new SmtpClient("localhost",25);
                smtp.Host = "smtp.gmail.com";  
                smtp.Credentials = new System.Net.NetworkCredential
                     ("abc@gmail.com", "mygmailpassword");
                
                smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                smtp.EnableSsl = true;
                
                smtp.Send(mail);
                Label1.Text = "Mail has been sent";


可能是SMTP未配置或您使用了一些错误的值,或者您正在使用其他一些名称空间。请提供一些代码来解决问题。
May be SMTP is not configured or you using some wrong values for it or may be you are using some other namespaces. Please provide some code to figure out the problem.


这篇关于Asp.net中sendind SMTP电子邮件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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