The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available


Please help me I am using this script..

Found the full code Here

 public void sendemail(int MemberId, DataTable Member, int rowNo)
        MailMessage msgMail = new MailMessage();

        msgMail.To = Member.Rows[rowNo]["EmailID"].ToString();
        msgMail.From = ""; 
        msgMail.Subject = "Auditions BollyWood Account Expire";
        msgMail.BodyFormat = MailFormat.Text;
        StringBuilder sb = new StringBuilder();
        sb.AppendFormat("Hi !\n\n");
        sb.AppendFormat("Your Audition Bollywood Account has been expired.Please pay the payment for activation.\n");
        sb.AppendFormat("Click the below link to pay to activate your account\n");
        string link = string.Format("{0}", MemberId.ToString());
        sb.AppendFormat("\n\nThank You");
        msgMail.Body = sb.ToString();
        msgMail.Fields.Add("", "");
        msgMail.Fields.Add("", 587);
        msgMail.Fields.Add("", 2);
        msgMail.Fields.Add("", "1");
        msgMail.Fields.Add("", "");
        msgMail.Fields.Add("", "**********");
        SmtpMail.SmtpServer = "";
asked on Stack Overflow Jul 3, 2015 by Kushal Gupta • edited Jul 3, 2015 by Abdulla Nilam

2 Answers


The symbolic name for error code 0x80040217 is CDO_E_LOGON_FAILURE which has the following description:

The transport was unable to log on to the server.

You need to provide valid credentials to send using that SMTP server.

answered on Stack Overflow Jul 3, 2015 by Martin Liversage

The error means that the SMTP server rejected your e-mail.Reasons:

  1. information is incorrect

  2. SMTP server does not allow you to send e-mails externally.Check with SMTP administrator.

3.change email login security not to use the 2-step verification, but only a password.

answered on Stack Overflow Jul 3, 2015 by WannaLearn

User contributions licensed under CC BY-SA 3.0