Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 819
  • Last Modified:

Sending Email Using ASP and Exchange 2007

I am setting up a new Exchange 2007 server to replace our existing Exchange 2000 server.  I have a website on my development machine (Vista Business, IIS 7) that generates emails and sends them via an account on the old mail server.  I have moved the email account to the new Exchange 2007 server, specified the new server as the SMTP server on my ASP page, and now the ASP web page gives me the following error:

An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error

If I change my code to use the old Exchange 2000 server as the SMTP server, it works again - The email account being used remains on the 2007 server, though.  I am using SMTP authentication both servers, but it only works with the old server.

Any ideas?

Thanks in advance,
  • 2
  • 2
1 Solution
Classic ASP?

Can you turn on full error reporting for ASP temporarily to get the real error?
rlwhitneyAuthor Commented:
Thanks for your reply...

Yes, I am using "classic" ASP, but the URL you posted is for IIS 5.0 - I am using IIS 7.0.

I went to my IIS manager, double-clicked on the ASP applet, and made the following changes:

Enable Client-side Debugging: False -> True
Enable Server-side Debugging: False -> True
Send Errors to Browser: False -> True

Now when I open the ASP page, I get the following error:
error '8004020e'
/sendpod.asp, line 150

Line 150 of my sendpod.asp file is the following:
'Send the e-mail to the recipient.

I am using CDO to send the message - It appears to be an SMTP server name/authentication issue.  My new mail server (the server that doesn't send the message) is strictly a mail server.  My old mail server (the one that does send the message successfully) is a mail/Windows 2000 DC.  Both servers are on the same domain/forest.
Sorry, I didn't see you were using IIS7.

I suspect it's something like the SMTP server requires authentication. Try to simulate the conversation using telnet to port 25 (You'll need to install the telnet feature) You need to type what appears after the >

> telnet SERVERNAME 25
220 SERVER.local Microsoft ESMTP MAIL Service ready at Tue, 21 Apr 2009 16:39:04 +0100
> HELO test.local
250 SERVER.local Hello []
> MAIL FROM: test@test.com
250 2.1.0 Sender OK
> RCPT TO: test@test.com
550 5.7.1 Unable to relay

In this case the error I got was Unable to Relay, as I hadn't authenticated.
rlwhitneyAuthor Commented:
OK brislane, I tried your test - I entered legit email addresses for the MAIL FROM and RCPT TO, and of course didn't get the "Unable to relay" error that your example above shows.  I entered DATA and "this is a test", and sent the message.
When I telnet to the old mail server (Exchange 2000, Windows 2000, DC) and perform the test, the message gets to the destination fine, and the sender's email address is resolved to the user's First and Last name, even though both the sender and recipient reside on the new server.

When I telnet to the new mail server (Exchange 2007, Windows 2003) and perform the test, the message gets to the destination without a body (no message, just from, to, and subject).  Also, the sender is just displayed as his email address (no first or last name).

One thing I thought odd was that the telnet session never prompted me to "login".  Does this mean it is using my currently logged in user's credentials?  If so, what credentials is my website trying to use?  I am specifying smtpauthenticate, sendusername, and sendpassword for the CDO object, but it of course isn't working...


Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now