SMTP problem with text messaging on WS2008

Hi - I've finally gotten my email to work and the text messaging did work, but now when I send them out, they stay in the queue and one error message is:
Message delivery to the host '' failed while delivering to the remote domain '' for the following reason: An SMTP protocol error occurred.
then something about unable to match sender with  - can't find that again.
DNS has not changed from old server to new.
Using simple ASP.

The same code worked on WS2003 and has worked on this server before.
The only changes were to enable 32 bit on the Application Pool.
I did catch a hacker sending 120,000 email messages through on the server today and had to delete them all and I closed port 25 for incoming -
IIS 6.0 (SMTP) is using anonymous - no authentication required.

Set objEmail = CreateObject("CDO.Message")
objEmail.From = ""   ' also used an email address
objEmail.To = ";"  ' email gets delivered
objEmail.textbody = "test"
objEmail.Configuration.Fields.Item _
 ("") = 2
objEmail.Configuration.Fields.Item _
 ("") = ""
objEmail.Configuration.Fields.Item _
 ("") = 25

XML view:
- <Event xmlns="">
- <System>
  <Provider Name="smtpsvc" />
  <EventID Qualifiers="32772">4006</EventID>
  <TimeCreated SystemTime="2012-03-28T23:31:54.000000000Z" />
  <Security />
- <EventData>
  <Data>An SMTP protocol error occurred.</Data>

Thanks in advance!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Can't you require authentication?  Couldn't somebody just keep trying a different port until it worked?  I would require authentication.  Then in your cdo script use the sample here as a base. Also just by dumb luck, could you be blocked by for TOS?

Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory. 
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network). 

Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM

Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = "Example CDO Message" 
objMessage.From = """Me"" <>" 
objMessage.To = "" 
objMessage.TextBody = "This is some sample message text.." & vbCRLF & "It was sent using SMTP authentication."

'==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
("") = 2 

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("") = ""

'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("") = cdoBasic

'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("") = "youruserid"

'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("") = "yourpassword"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("") = 25 

'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("") = False

'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("") = 60


'==End remote SMTP server configuration section==


Open in new window

dcassAuthor Commented:
Maybe I'm missing something but would making it authenticated help get it through?
And I'm using localhost as the smtpserver - "localhost" and I've tried "".  Is that a problem?
dcassAuthor Commented:
Tried to add authentication - added it to both SMTP and to the specific web site under SMTP, but now no emails are going out at all:
     Set myMail=CreateObject("CDO.Message")
     sSubject = "Web Site Registration"

       myMail.Subject = sSubject
       myMail.From= ""

         myMail.To=""  ' not the real email
             myMail.Configuration.Fields.Item _
             ("") = 2
            myMail.Configuration.Fields.Item _
             ("") = ""
            myMail.Configuration.Fields.Item _
             ("") = 25
myMail.Configuration.Fields.Item _
("") = 1
myMail.Configuration.Fields.Item _
("") = "user"
'Your password on the SMTP server
myMail.Configuration.Fields.Item _
("") = "pwd"
                Set myMail = Nothing
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

dcassAuthor Commented:
I meant to say:
Tried to add authentication - added it to both SMTP and to the specific web site under IIS, but now no emails are going out at all.

Then I removed everything I had added and everything still sticks in the QUEUE - no messages anywhere, no problems that I can see - I restarted both smtp and IIS and nothing.

This is getting real annoying - I hope someone can help !
Check in the badmail folder. Do you see anything in there?
dcassAuthor Commented:
Nothing - it's all in the Queue - with a message they have been delayed, but they never go through.  I'm having a smart host set up today and hoping that uscellular has not put us in their spam list.  We are not on Spamhaus - we don't allow spam and we know all of our customers.
dcassAuthor Commented:
Do you need to set up authentication at the SMTP level or on each web site in IIS or both?
If we use NTLM, do we still put in a user name and password when we send, and won't that be sent in clear text?
dcassAuthor Commented:
I also would like to know how to set the The Content-Type Header Field - it is coming though as bit7 and maybe it should be quotable-printable or base64.
Well, users are strongly encouraged to avoid using ntlm unless you have strongly typed passwords
dcassAuthor Commented:
OK, I'll use basic or strong passwords.
This may well solve my problems if I can figure out how to set the Content-Type Header Field - it is coming though as 7bit and maybe it should be quotable-printable.
but what are you using the content_type header for?

Is it to format the body of your text?
dcassAuthor Commented:
Maybe you can't set the header on smtpsvc - but it definitely is to format the body of the text.
Well, you probably can but it is more pain than it is worth.

What I do is use body to format and style my text:

body = "<font color='firebrick'>Hello:</font><br>" _
       & "<font color='000000'>This is to inform you that a potential new parishioner has just sent you a mebership registration form</font><br>" _
       & "<font color='000000'> Please click the link below to print the form</font><br>" _
       & "<font color='blue'><a href='" & (familyEmail) & "'>Click Here</a></font><br>"

Open in new window

Add as much text as needed separatinb by _ .

Inside your mail, you simply use as:

myMail.HTMLBody = Replace(""&body& "",vbCrLf,"<br>"&vbCrLf)

Open in new window

It writes and renders as formatted.
dcassAuthor Commented:
Yes, that normally works - and it did until I tried to set authentication, but now nothing works.
when you say, "nothing works", what do you mean?

Are you getting an error?

Can you post your code, removing or hiding any confidential stuff?
dcassAuthor Commented:
Sometimes email goes out, sometimes it sits in the queue.  Today, it's sitting in the queue.
I can't figure out what is making the difference.

Is there anyway for emails waiting to go out to get ahead of the ones that won't go out for whatever reason?

I already posted the code (above).

I did find that I'm on the barracuda spam list, which is really funny because I've only been able to send out a few emails myself and someone else was using it to send out hundreds of thousands (and theirs was going out until I cleaned out the queue).

Are there any other black lists to check besides spamhaus and barracuda?
Emails will go out regardless of whether the emails are on spam list or not.

If they are on spam list, they go into spam box but go out anyway.

if they are rejected, that's a separate email.

What you could do is go back into smtp server under Messages tab and configure it to send Non Delivery report to badmail folder.

This way, you can review and see what could be preventing emails from queueing up and not getting sent out.

Also, change event viewer for error messages and possible causes of emails getting stuck in the queue folder.

It is also my believe that it is possible that the email destinations are not answering due to perhaps, restrictive email screening protocols.  As long as you know the address is correct, and you have checked the SMTP log file for possible hints, it's a problem outside your control; really not much you can do especially given the fact you have noted that some do fly - an indication that your code works.
dcassAuthor Commented:
SMTPSVC LOG but I don't know how to read it or what it means:

#Fields: date time cs-username s-sitename s-computername s-ip s-port cs-method sc-win32-status cs(User-Agent)

2012-03-30 02:14:15 OutboundConnectionCommand SMTPSVC1 CWEB - 25 EHLO 0 -
2012-03-30 02:14:15 OutboundConnectionResponse SMTPSVC1 CWEB - 25 - 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 0 HELO 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 0 MAIL 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 0 RCPT 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 0 RCPT 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 0 DATA 0 -
2012-03-30 02:15:10 CWEB SMTPSVC1 CWEB 0 QUIT 141 -

It was set for folder badmail, but nothing is there.

It's the same email address being delivered from time to time.

General tab
IP Address = All unassigned (should this be the local ip address of the
server which is the only one in the list?

Access Tab
Authentication - Anonymous
Connection - All except the list below is selected, and there are no
computers in the list
Relay - All except the list below is selected, and there are no
computers in the list

Delivery Tab
Advanced - No Masquerade Domain or smart host (no idea what to do here
at all - can we use or isp smtp server? If so, how do we authenticate
with it?)
Maximum hop count = 15
FQDN resolves ok with the Check DNS button
Perform reverse DNS lookup is NOT checked.
Outbound Security - Anonymous access
TLS Encryption is not checked

LDAP Routing Tab
Enable LDAP Routing is not checked, all others are greyed out.

Security Tab
Operators are Administrators, Network Service and Local Service

In the domain list for the Default SMTP Virtual Server, only the FQDN (CWEB)
of the machine is there.

If someone has a complete list of things I should do regarding settings
changes and/or reboots etc, I would be most grateful!
dcassAuthor Commented:
Also, when I search on http headers on network-tools, I get:

Server returned error: 404 Server returned error information for request
Header are:

HTTP/1.1 404 Not Found
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 30 Mar 2012 22:30:54 GMT
Connection: close
Content-Length: 315
dcassAuthor Commented:
One more thing, the IP and PTR do not match - the PTR is
dcassAuthor Commented:
Another bit of information:
Warning in event viewer on smtpsvc:
Message delivery to the host '' failed while delivering to the remote domain '' for the following reason: An SMTP protocol error occurred.
Log Name:System
Source: smtpsvc
Event ID:  4006
Level: Warning
User: N/A
Keywords: Classic
Computer: CWEB
dcassAuthor Commented:
since no one has responded to this in a few days and I know it's not a code problem and it is an smtpsvc error, I would like to close this.  I think it has to do with DNS and PTR or reverse lookup - something is not set up right on the server.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dcassAuthor Commented:
No answer - opening new question
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.