Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29748

Port seems to be blocked when trying to send email from Excel VBA

$
0
0

I have a simple VBA script to send email from Excel. The script worked yesterday from my hotel; however, today from home on my home network, I get this error: "The transport failed to connect to the server." My home network uses Google wifi points and connects VIA Comcast Xfinity. If I set up a hotspot from my phone using the AT&T network it works fine. Would that mean this port is blocked either on my home network or at XFinity? Any ideas on how to fix this? Thanks. Script is below:

Dim Mail As New Message
Dim Config As Configuration
Set Config = Mail.Configuration

Config(cdoSendUsingMethod) = cdoSendUsingPort
Config(cdoSMTPServer) = "smtp.gmail.com"
Config(cdoSMTPServerPort) = 25
Config(cdoSMTPAuthenticate) = cdoBasic
Config(cdoSMTPUseSSL) = True
Config(cdoSendUserName) = "****"
Config(cdoSendPassword) = "****"
Config.Fields.Update

Mail.To = Config(cdoSendUserName)
Mail.From = Config(cdoSendUserName)
Mail.Subject = "Subject"
Mail.TextBody = "Body"

On Error Resume Next

Mail.Send

If Err.Number <> 0 Then
    MsgBox Err.Description, vbCritical, "There was an error"
    Exit Sub
End If

Viewing all articles
Browse latest Browse all 29748

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>