本文介绍了检查给出的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了此代码.消息显示电子邮件已成功发送,但我的网站的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("[email protected]");
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>
推荐答案
这篇关于检查给出的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!