send mail with siging

0 votes
asked Apr 20, 2011 by kani (120 points)
edited Apr 20, 2011

I used Rebex component to send a mail, i getting error

One or more recipients rejected. Call SmtpException.GetRejectedRecipients() to get a collection of rejected email addresses

This is code

        Dim recipient As Certificate = Certificate.LoadPfx("F:\Project\Certificate\PC201104199220.pfx", "password")

        ' create an instance of MailMessage 
        Dim message As New MailMessage()
        Dim client As New Smtp

        ' set its properties to desired values 
        message.From = "test@gmail.com"
        message.[To] = "test1@gmail.com "
        message.Subject = "This is a simple message"
        message.BodyText = "Hello"
        message.BodyHtml = "Hello "

        client.Connect("chandru")

        message.Sign(recipient)

        client.Send(message)

Please let me know if anything i miising

Applies to: Rebex Secure Mail

1 Answer

0 votes
answered Apr 20, 2011 by Jan Sotola (16,930 points)
edited Apr 20, 2011

Could you please check whether the error is (or is not) related with signing your message? Just try to ommit calling the message.Sign(recipient) and execute the code again.

The described error message usually occurs when you are connecting to SMTP server that requires authentication and you don't provide correct login and password. Please check whether your SMTP server requires authentication.

...