asp.net BCC MAILMESSAGE和CC将无法正常工作 [英] asp.net mailmessage BCC and CC won't work

查看:595
本文介绍了asp.net BCC MAILMESSAGE和CC将无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁看到什么不对的code:

 味精MAILMESSAGE新= MAILMESSAGE();msg.From =新的MailAddress(WebConfigurationManager.AppSettings.Get(ReservationsFrom));
msg.ReplyTo =新的MailAddress(myRes.Email);
msg.To.Add(新MailAddress(WebConfigurationManager.AppSettings.Get(ReservationsTo)));
msg.CC.Add(新MailAddress(WebConfigurationManager.AppSettings.Get(ReservationsBcc)));

尝试,因为我可能,我只能得到'地址和的ReplyTo工作,CC和BCC永远不会收到邮件,即使我很难code中的地址在

我失去了一些东西明显在这里?

编辑:是的,我相信我右拉出来的地址在web.config中 - 就像我说的,即使我很难code静态地址的BCC和CC从未收到电子邮件


解决方案

我有类似的问题,检查SMTP日志

。看起来像.NET只发送一个消息,如果收件人和抄送/密件抄送ADRESS相同。

Does anyone see anything wrong with this code:

MailMessage msg = new MailMessage();

msg.From = new MailAddress(WebConfigurationManager.AppSettings.Get("ReservationsFrom"));
msg.ReplyTo = new MailAddress(myRes.Email);
msg.To.Add(new MailAddress(WebConfigurationManager.AppSettings.Get("ReservationsTo")));
msg.CC.Add(new MailAddress(WebConfigurationManager.AppSettings.Get("ReservationsBcc")));

Try as I might, I can only get the 'To' address and the "ReplyTo" to work, the CC and the BCC never receive mail, even if I hard code the addresses in.

Am I missing something obvious here?

Edit: And yes, I am sure I am pulling the right addresses out of the web.config - like I said, even if I hard code a static address the BCC and CC never received email.

解决方案

I had similar problem and checked the smtp log. Looks like .net sends only one message, if "To" and "Cc"/"Bcc" adress are same.

这篇关于asp.net BCC MAILMESSAGE和CC将无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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