title: Port 25 is blocked trying to send CDO email from Excel VBA
body: <p>I have a VBA script to send email from Excel.</p>
  <p>The script worked yesterday from my hotel; however, today from home on my home network, I get this error:</p>
  <blockquote>
  <p>&quot;The transport failed to connect to the server.&quot;</p>
  </blockquote>
  <p>My home network uses Google wifi points and connects VIA Comcast Xfinity. If I set up a hotspot from my phone using the AT&amp;T network it works fine. Would that mean this port is blocked either on my home network or at XFinity?</p>
  <p>Script is below:</p>
  <pre><code>Dim Mail As New Message
  Dim Config As Configuration
  Set Config = Mail.Configuration
  
  Config(cdoSendUsingMethod) = cdoSendUsingPort
  Config(cdoSMTPServer) = &quot;smtp.gmail.com&quot;
  Config(cdoSMTPServerPort) = 25
  Config(cdoSMTPAuthenticate) = cdoBasic
  Config(cdoSMTPUseSSL) = True
  Config(cdoSendUserName) = &quot;****&quot;
  Config(cdoSendPassword) = &quot;****&quot;
  Config.Fields.Update
  
  Mail.To = Config(cdoSendUserName)
  Mail.From = Config(cdoSendUserName)
  Mail.Subject = &quot;Subject&quot;
  Mail.TextBody = &quot;Body&quot;
  
  On Error Resume Next
  
  Mail.Send
  
  If Err.Number &lt;&gt; 0 Then
      MsgBox Err.Description, vbCritical, &quot;There was an error&quot;
      Exit Sub
  End If
  </code></pre>