Hi,
I am using below code to send email but getting:
The operation has timed out.
evertime I try to send an email
I am hosting with dreamhost.
What could be the issue please?
Thanks,
Jassim
mail_message = new MailMessage();
smtp_client = new SmtpClient("mail.mybluefile.com");
mail_message.From = new MailAddress("noreply-employee-request@mybluefile.com", "BlueFile");
mail_message.To.Add(new MailAddress(Convert.ToString(sql_command.Parameters["param_employee_email"].Value), Convert.ToString(sql_command.Parameters["param_employee_name"].Value)));
email_body = new StringBuilder();
email_body.Append("<i>Please do not reply to this message. Replies to this message are routed to an unmonitored mailbox.</i>");
email_body.Append("<hr>");
email_body.Append("<br><br>");
email_body.Append("My message here......";
email_body.Append("<br>");
email_body.Append("Best Regards,");
email_body.Append("<br>");
email_body.Append("BlueFile");
mail_message.Subject = cboCategory.Text + " Request is Completed";
mail_message.IsBodyHtml = true;
mail_message.Body = email_body.ToString();
smtp_client.Port = 465;
smtp_client.Credentials = new System.Net.NetworkCredential("noreply-employee-request@mybluefile.com", "xxxxxxxx");
smtp_client.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
smtp_client.Send(mail_message);