trouble with email

Discussion in 'Email' started by martymav, Feb 19, 2012.

  1. I have gone through all threads on Winhost and tried everything but I am still unable to send an email to contact - I get 'failure to send email' error message. below is my code I substituted domain for my website and password for my password.

    MailMessage myMessage = new MailMessage();
    myMessage.From = new MailAddress(sendEmail, sendName);
    myMessage.To.Add(new MailAddress("[email protected]"));
    myMessage.Subject = "Customer Contact";
    myMessage.Body = mailBody;
    myMessage.IsBodyHtml = true;

    SmtpClient mySmtpClient = new SmtpClient();
    NetworkCredential AuthenticationInfo = new NetworkCredential("[email protected]", "password");
    mySmtpClient.Host = "mail.domain.com";
    mySmtpClient.Port = 587; // 25
    mySmtpClient.UseDefaultCredentials = false;
    mySmtpClient.Credentials = AuthenticationInfo;

    mySmtpClient.Send(myMessage);
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Could you open up a support ticket so we could investigate further? Please include a URL of your web form.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page