I searched and came across many codes demonstrating mail sending using gmail's smtp with c#
Here is my smtpclient configured to send email.
SmtpClient smtp = new SmtpClient
{
Host = MailSettings.SMTP, // smtp server address here...
Port = 465,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
Credentials = credentials,
Timeout = 30000,
UseDefaultCredentials = false
};
This code works very fine with host as smtp.gmail.com
But when it comes to other Hosts, it fails.
It doesnt send mails.
Can anyone help me with this.