locked
send email RRS feed

  • Question

  • Hello,
    I am trying to send email through the windows wcf service and I wanted to include the email address only in BCC list and not in the "To"
    So when I try to this, my email is not getting send and in the service application log I get this warning message " The parameter 'to' cannot be an empty string.

    Is it possible to include email address only in the BCCList ? Is this possible at the first place ?

    Thank you

    - Manju

    Friday, August 7, 2009 1:43 PM

Answers

  • Yes, you can send emails with address only in BCC List. Below code worked for me (except i concealed the hostname and email addresses)

            Dim mailServerClient As SmtpClient = New SmtpClient
            mailServerClient.Host = "HOSTNAME"
            mailServerClient.Port = 25
            Dim fromAddr As MailAddress = New MailAddress("email@address.com")
            Dim mailMsg As MailMessage = New MailMessage()
            mailMsg.From = fromAddr
            mailMsg.Subject = "test"
            mailMsg.Bcc.Add("email2@address.com")
            mailServerClient.Send(mailMsg)
    • Proposed as answer by ssaranv Monday, August 10, 2009 1:04 PM
    • Marked as answer by Riquel_DongModerator Friday, August 14, 2009 11:15 AM
    Friday, August 7, 2009 7:11 PM