0

i am trying to send an email using asp classic. using the code below, i get no errors. however the emails do not arrive at all. all messages are directly sent to my BadMail folder. any ideas as to why this is happening?

<%
Set ObjSendMail = CreateObject("CDO.Message")

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "d:\Inetpub\mailroot\Pickup"
ObjSendMail.Configuration.Fields.Update

ObjSendMail.From = "myemail@domain.com"
ObjSendMail.To = "targetemail@anotherdomain.com"

ObjSendMail.Subject = "TEST EMAIL"

ObjSendMail.TextBody="This is a message."

ObjSendMail.Send
set ObjSendMail=nothing
%>
user571099
  • 1,491
  • 6
  • 24
  • 42

1 Answers1

0

OK, not a lot of detail, but here's my experience. Certain smtp servers require a different port number. For instance, gmail requires port 465. Here's some more info on sending via gmail: Send mail with CDO through Google Apps gives transport error: CDO.Message.1 error '80040213'

If you're using another smtp server, then try googling the key words cdo, asp, and whatever your server is.

Hope this helps. Good luck.

Community
  • 1
  • 1
Tom Collins
  • 4,069
  • 2
  • 20
  • 36