Asp.net mailmessage BCC and CC will not work

Does anyone see something 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 best I could, I can get the "To" and "ReplyTo" addresses to work, CC and BCC will never receive mail, even if I hard-code the addresses.

Did I miss something obvious here?

Edit: And yes, I'm sure that I am taking the correct addresses from web.config - as I said, even if I hardcode the static address, BCC and CC never received email.

+4
source share
2 answers

I had a similar problem and checked the smtp log. It seems that .net only sends one message if the To and Cc / Bcc recipients are the same.

+3
source

If the static addresses that are hardcoded in the method call do not work, you have a delivery problem, not an address.

Can you connect telnet to port 25 on the smtp host that you are using? Can you send an email to test addresses from a regular email client (and not on a website)?

+2
source

All Articles