从发送邮件的地址未显示在recepeint收件箱中 [英] From address of sending mail not showing in recepeint inbox
本文介绍了从发送邮件的地址未显示在recepeint收件箱中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
MailMessage Msg = new MailMessage();
// Sender e-mail address.
Msg.From = new MailAddress(txtEmail.Text);
// Recipient e-mail address.
Msg.To.Add("info@dhuvara.com");
Msg.Subject = txtEmail.Text;
Msg.Body = "NAME : " + txtName.Text + "EMAIL : " + txtEmail.Text + " SUBJECT : " + txtSubject.Text + "MESSAGE: " + txtMessage.Text;
Msg.IsBodyHtml = true;
// your remote SMTP server IP.
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.live.com";
smtp.Port = 587;
Msg.Priority = MailPriority.Normal;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new System.Net.NetworkCredential("info@dhuvara.com", "SolaiMail");
smtp.EnableSsl = true;
smtp.Send(Msg);
//Msg = null;
lbltxt.Text = "Thanks for Contact us";
// Clear the textbox valuess
txtName.Text = "";
txtSubject.Text = "";
txtMessage.Text = "";
txtEmail.Text = "";
}
catch (Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex.ToString());
}
推荐答案
我建议您查看本教程>> http://blogs.technet.com/b/sbs/archive/2007/11/06/how-to-send-e-mails-with-exchange-using-a-different-from-address。 aspx [ ^ ]
试试吧!希望它可以帮到你。
I reference you to check this tutorial >> http://blogs.technet.com/b/sbs/archive/2007/11/06/how-to-send-e-mails-with-exchange-using-a-different-from-address.aspx[^]
Try! Hope it can help you.
这篇关于从发送邮件的地址未显示在recepeint收件箱中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文