-3

I'm trying to make a vbs code that e-mails some text but the network here is blocking port 25 is there a way of doing this through port 80 or some way to send a message through port 80 at least.

I got this error code when I tried: 80040213

Here is my code:

dim strSMTPFrom, strSMTPTo, strSMTPRelay, strTextBody, strSubject, oMessage
strSMTPFrom = "email@gmail.com"
strSMTPTo = "email@gmail.com"
strSMTPRelay = "smtp-relay.gmail.com"
strTextBody = "test"
strSubject = "test"
Set oMessage = CreateObject("CDO.Message")
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configurati on/sendusing") = 2
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPRelay
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configurati on/smtpserverport") = 25
oMessage.Configuration.Fields.Update
oMessage.Subject = strSubject
oMessage.From = strSMTPFrom
oMessage.To = strSMTPTo
oMessage.TextBody = strTextBody
oMessage.Send
Tijmen
  • 3
  • 3

1 Answers1

0

Nowadays most ISPs block outgoing connections to port 25 in an attempt to fight botnet spam. There are 2 customary ways of dealing with this:

  • Send the mail through the ISP's mail servers (if the ISP provides a mail gateway for its customers).
  • Send the mail to a mail submission server hosted by yourself or your mail provider via an (authenticated) connection to port 587 (submission) or port 465 (smtps, deprecated).

Technically you can send mail via port 80 if you set up a mail server that accepts mail on that port. Doing so isn't common (or recommended) practice, though.

Community
  • 1
  • 1
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328