I want to send email thorw my godaddy email Server, I using this code
MailMessage msg = new MailMessage(); msg.To.Add(txtemail.Text.Trim()); MailAddress address = new MailAddress("[email protected]"); msg.From = address; msg.Subject = "Email"; string htmlBody = @" <!DOCTYPE html> <html> <head> <title>Email</title> </head> <body> <h1> Hi welcome </h1> <p> Thank you for register</p> </body> </html>
msg.Body = htmlBody; msg.IsBodyHtml = true; SmtpClient client = new SmtpClient(); client.Host = "smtpout.secureserver.net"; client.Port = 465; client.UseDefaultCredentials = false; client.Credentials = new System.Net.NetworkCredential("[email protected]", "password"); //Send the msg client.Send(msg);
But its shows operation timeout error.