This might be a silly question, but I have vba email code working perfectly fine through a wireless router network.
Set objMessage = CreateObject("CDO.Message")
myAttachment = "C:\Documents\Folder\Name" & ".pdf"
objMessage.Subject = "Subject"
objMessage.From = "send@email.com"
objMessage.Cc = "send@email.com"
objMessage.To = "sendto@email.com"
objMessage.TextBody = "Hello "
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...tion/sendusing") = 2
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...tpauthenticate") = 1
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...n/sendusername") = "email@stny.rr.com"
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...n/sendpassword") = "password1234"
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = "smtp-server.stny.rr.com"
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...smtpserverport") = 25
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...ion/smtpusessl") = false
objMessage.Configuration.Fields.Item_("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 60
objMessage.Configuration.Fields.Update
objMessage.SEND
Set objMessage = Nothing
i = MsgBox("Email Sent", vbOKOnly, "Email Sent")
I tried to incorporate it in another office, and I kept getting run time error 438, highlighting the sendusing = 2 line.
The only difference I noticed was that this office was using an Ethernet cable through a phone jack in the wall, rather than a wireless router.
I tried different ports and well as 1 and 3 for sendusing.
Would this make a difference? If so, is there a solution to change something so I can use it there too?
Any help would be appreciated.
Thank you!
alyon