Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I am having some trouble with sending CC mail via SMTP. The Webmaster gets his mail from an online form and in his message I can see the email address of who is supposed to be copied in, but the person himself does not actually receive a copy of the
Webmaster's message.

I have tried various conjugations of this:

myMessage.CC.Add(New MailAddress("admin@mysite.com")) 'Webmaster's assistant


but they don't work.

There are no errors either in Visual Studio or server errors from my Web hosting service.

Thanks for any advice.

What I have tried:

I was trying to use something like this:

Dim CC As MailAddress = New MailAddress()
but I get an 'overload' error with New MailAddress underlined in blue.
Posted
Updated 24-Jan-18 10:57am

According to the example in the documentation (MailMessage.CC Property (System.Net.Mail)[^]) what you are doing appears correct. You should try and get a copy of a successfully delivered message, and check the raw content to see if anything has been changed. Also if possible get the server logs.

The reason for the other error is that the MailAddress class does not have a constructor that takes no parameters. The documentation will always clarify such questions.
 
Share this answer
 
Thanks, Richard for your reply.

Regarding your paragraph here: The reason for the other error is that the MailAddress class does not have a constructor that takes no parameters.

Do you mean I should do something like

Dim CC As MailAddress = New MailAddress("me@myemail.com")


Thanks again!
 
Share this answer
 
Comments
RedDk 24-Jan-18 17:13pm    
RM won't be notified of your follow up question unless you use the "Have a Question or Comment?" And technically this is not a Solution (this one, number 2).
Richard MacCutchan 25-Jan-18 4:42am    
Yes, as shown in the documentation that I referred you to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900