title: Run time error - 2147220973 (80040213) The transport failed to connect to the server while sending mail from vb6
body: <p>I am making one application in vb6 which sends mail from an application, it gives me </p>
  
  <blockquote>
    <p>Run time error - 2147220973 (80040213) The transport failed to contact
    to the server</p>
  </blockquote>
  
  <p>, I did all the given solution gives before</p>
  
  <p>Please help if any one knows solution.</p>
  
  <p>Code:
  code:</p>
  
  <pre><code>{
  mStrProcName = "MonthlyXlMail_EmployeePerformance"
  sFilePath = (App.Path &amp; "\TimeTaken.xls")
    iConf.Load -1
  
  Set Flds = iConf.Fields
  Set lobj_cdomsg = New CDO.Message
  
  lobj_cdomsg.Configuration.Fields(cdoSMTPServer) = Trim(rsMail!ServerUrl)
  lobj_cdomsg.Configuration.Fields(cdoSMTPServerPort) = CInt(Trim(rsMail!Port))
  lobj_cdomsg.Configuration.Fields(cdoSMTPUseSSL) = IIf(rsMail!ReqSSL = "Y", True, False)
  
  lobj_cdomsg.Configuration.Fields(cdoSMTPAuthenticate) = cdoBasic
  lobj_cdomsg.Configuration.Fields(cdoSendUserName) = Trim(rsMail!EMailID)
  lobj_cdomsg.Configuration.Fields(cdoSendPassword) = Trim(rsMail!EmailPassword)
                          lobj_cdomsg.Configuration.Fields(cdoSMTPConnectionTimeout) = 30
  
  lobj_cdomsg.Configuration.Fields(cdoSendUsingMethod) = cdoSendUsingPort
  lobj_cdomsg.Configuration.Fields.Update
  
  lobj_cdomsg.To = Trim(strMail)
  
  lobj_cdomsg.From = Trim(rsMail!EMailID)
  
  lobj_cdomsg.Subject = IIf(Len(Trim(txtsubject.Text)) = 0, "Performance Report", Trim(txtsubject.Text))
  
  lobj_cdomsg.TextBody = IIf(Len(Trim(txtDescription.Text)) = 0, "Find Attachment", Trim(txtDescription.Text))
  
  'lobj_cdomsg.HTMLBody = strMsg
  lobj_cdomsg.AddAttachment (sFilePath)
  
  lobj_cdomsg.Send
  }
  </code></pre>