asp.net BCC MAILMESSAGE和CC将无法正常工作 [英] asp.net mailmessage BCC and CC won't work
问题描述
有谁看到什么不对的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日志
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屋!