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.
If static addresses hard-coded into the method calls aren't working, you're having a problem with delivery, not the addresses.
Can you telnet to port 25 on the smtp host you're using? Can you send an email to the test addresses from a regular email client (not web-based)?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With