检查给出的代码 [英] Check the code given

查看:75
本文介绍了检查给出的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了此代码.消息显示电子邮件已成功发送,但我的网站的Web邮件的邮件"框中没有邮件.

我的代码在下面

I used this code.Message showing Email Successfully sent but mail is not in Mail box of Web mail of my website.

My code is given below

void send(Object sender, EventArgs e)
   {
  SmtpClient smtpClient = new SmtpClient();
  MailMessage message = new MailMessage();
  try
  {
   MailAddress fromAddress = new MailAddress(t1.Text, t2.Text);
     smtpClient.Host = "webmail.kamnatrust.com";
     //Default port
     smtpClient.Port = 25;
     message.From = fromAddress;
     message.To.Add("contact@kamnatrust.com");
     message.Subject = "Feedback";
     message.IsBodyHtml = true;
     message.Body = t3.Text;
     smtpClient.Send(message);
     l1.Text = "Email successfully sent.";
     }
     catch (Exception ex)
     {
     l1.Text = "Send Email Failed.<br>" + ex.Message;
   }
   }</br>

推荐答案

当今大多数电子邮件服务器都要求您先经过身份验证,然后才能通过SMTP协议发送电子邮件.

如果您的情况需要这样做,请与您的邮件管理员联系.
Most email server today require you to be authenticated before sending your email via the SMTP protocol.

Check with your mail administrator if this is required in your case.


请不要一遍又一遍地重复同样的问题.已为您提供了解决此问题的许多建议,但您仍然忽略了这些建议,只是随意更改参数值以希望有效果.与您的服务提供商一起尝试对此问题进行一些适当的调试和调查.
Please stop repeating this same question over and over. You have been given lots of suggestions to resolve this issue, but you are still ignoring those suggestions and just randomly changing parameter values in the hope that something will work. Try and do some proper debugging and investigation of this issue in conjunction with your service provider.


这篇关于检查给出的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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