Well the causes can be numerous:
- you did not reach the smtp server
- you reached it but it refused the connection
- it accepted the connection but the final recipient does not exist, or the server does not accept relaying to the varshaentreprises.in domain
- the recipient exist but the mail has been further filtered by the antispam engine
First, it is never a good idea to catch a general
. Better catch specific exception types which you know what to do with.
According to SmtpClient.Send Method (MailMessage)
], the different types of exception that can be thrown are
As you did not state whether you get an exception or not, hard to say.
Second, try to do a telnet session to this server on port 465 with these credentials, and try to send the mail. Does it work? Which SMTP codes are returned by the server?
Third, watch for the logs on the destination server; it could give you a clue.