反馈表不起作用

编程入门 行业动态 更新时间:2024-10-26 10:34:48
本文介绍了反馈表不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经从这一侧复制了反馈表单,该表单正在运行,但是邮件没有发送,并且显示发送电子邮件失败指定的字符串不是电子邮件地址所需的格式".请提供解决方案...

I have copy feedback form from this side it is running but mail is not going and it is giving"Send Email FailedThe specified string is not in the form required for an e-mail address".please give the solution of it...

using System; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Net.Mail; public partial class _Default : System.Web.UI.Page { protected void btnSendmail_Click(object sender, EventArgs e) { SmtpClient smtpClient = new SmtpClient(); MailMessage message = new MailMessage(); try { MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text); smtpClient.Host = "localhost"; smtpClient.Port = 25; message.From = fromAddress; message.To.Add("teddy.shally@gmail"); message.Subject = "Feedback"; message.CC.Add("teddy.shally@gmail"); message.CC.Add("agarwal.neha.0703@gmail"); message.Bcc.Add(new MailAddress("tushargupta251@gmail.")); message.Bcc.Add(new MailAddress("admin4@yoursite")); message.IsBodyHtml = false; message.Body = txtMessage.Text; smtpClient.Send(message); lblStatus.Text = "Email successfully sent."; } catch (Exception ex) { lblStatus.Text = "Send Email Failed" + ex.Message; } } protected void btnReset_Click(object sender, EventArgs e) { txtName.Text = ""; txtMessage.Text = ""; txtEmail.Text = ""; } }

推荐答案

其中一个电子邮件ID的格式错误.其中有两个com. The format for one of your email ids is wrong. There are two coms in it.

要通过您的应用发送邮件,请检查此链接,它将完全帮助您... myashkap.wordpress/ [ ^ ] for sending mail through your appication check this link it will definetly help you... myashkap.wordpress/[^]

更多推荐

反馈表不起作用

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

发布评论

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

>www.elefans.com

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