I am using this code for mailing a file using gmail:
This code works flawless at home connected to my home network. But on the road when connecting my laptop to my phone using as a hotspot it does not. I tried changing the SMTP server port to 465 but that does not help.
Any ideas what can cause this problem?
Code:
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
iConf.Load -1
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = Mailfrom
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = MailPW
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MailSMTP
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
DoEvents
With iMsg
Set .Configuration = iConf
.To = Mailto
.CC = ""
.BCC = ""
.From = Mailfrom
.Subject = MailSubject
.textbody = ""
.AddAttachment FileName
.send
End With
This code works flawless at home connected to my home network. But on the road when connecting my laptop to my phone using as a hotspot it does not. I tried changing the SMTP server port to 465 but that does not help.
Any ideas what can cause this problem?