Link to home
Start Free TrialLog in
Avatar of zhuansun
zhuansunFlag for United States of America

asked on

SMTP communication problem -- #5.50 smtp; 550 Blocked

Our classic asp web application will allow user to input their request information online, and send that information through email to our customer support staff.

the source code in xx.asp is:

            Set objMail = Server.CreateObject("CDONTS.NewMail")
            objMail.From="someuser@abc.com" // from user's filled in field
            objMail.To="Someone@ourdomai"
            objMail.Subject="Re: SMTP communication problem"
            objMail.Body="some email body"

            if objMail.To & "" <> "" then
                  intReturn=objMail.Send()
            end if
            set objMail = nothing

This asp application worked fine before, and I even don't know it has some problem until this morning someone reported error message.
As I tested, if both objMail.From and objMail.To are like **@ourdomain, the receipt will receive email from System Administrator like following:

We user Windows 2003 server with IIS 6.0 and Exchange server 2003.

calibrecpa.com is our domain.

Thanks

***************************************************************
Your message did not reach some or all of the intended recipients.

      Subject:      WEBSITE: Request for Intellectual Asset Management > Licensing Royalty Audit
      Sent:      10/30/2007 10:44 AM

The following recipient(s) could not be reached:

      Someone on 10/30/2007 10:44 AM
            There was a SMTP communication problem with the recipient's email server.  Please contact your system administrator.
            <xxxxxx.ourdomain #5.5.0 smtp;550 Blocked>
***************************************************************************
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

Here are a few things to look at:

1. Since you are using the object CDONTS.NewMail, you must have an instance of SMTP running as localhost.  Check to see if this is true.  If not, reset the SMTP config to "all available addresses"
2. Check the config to make sure that localhost (127.0.0.1) is allowed to relay, due to CDONTS.
3. Check the config to make sure that the address oF the server is allowed to relay email.
4. a 5.5.0 error can be thrown for the following reasons:
- - the user does not have permission to send an email
- - invalid TO address
- - invalid SMTP authentication account
- - the upstream SMTP server does not allow your server to relay

Dan
Avatar of zhuansun

ASKER

In our IIS 6.0, I can find "Default SMTP Virtual Server", and two items "Domains" and "Current Sessions".

Do you mean add "localhost" to the "Domains"? It should be Alias or Remote?

I don't know where 127.0.0.1 comes from?

I can change config by open properites window of "Default SMTP Virtual Server".

There is no problem when From address in not from our company email address.

There is no any problem whe we send email by outlook.


Your information seems useful. I will at least accept your solution as part of solutions

Thanks.
Also, there is no any problem to send email from ASP.NET 2.0 application.

ASP.NET source code is like:

        //Send email
        string strWebMailFrom = "name1@ourdomain";
        string strWebMailTo = "name2@ourdomain";


        System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(strWebMailFrom, strWebMailTo);
        message.Subject = "Re: Test Email";
        message.Body = "Test email \n\n";
        System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("email1");
        smtp.Send(message);
        message.Dispose();
        message = null;
        smtp = null;
Problem occurs only when classic asp application sends email between our company email accounts (From and To address are both like ***@calibrecpa.com). There is no problem for our comapny email account to send/receive email to/from other domian email accounts.

Asp.net 2.0 application works fine.

I need your help!!!!!!!

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Q:Have you modified the SMTP relay configuration?  Properties on Default SMTP Server >  Access Tab > Relay Restrictions... what is the config?  At least 127.0.0.1 should be there.

A: We have 10.68.10.15. I added 127.0.0.1 and problem still exists

Q: Are the applications (.NET & ASP classic) running in the same website or from to different sites with different IPs?

A: Yes, ASP.NET and ASP classic applications are running in the same domain but different virtual folder. Under our host web site, we create many virtual folders for different applications. All applications work fine except classic asp applications sending web emails within our network.

Q: What are the domains configured in IIS?  One should be a Local (Default) and be the name of the server... what is the other one you mentioned?

A: Yes, we have a default local domain with the server name.

Thanks for your help. I guess the problem is caused in our network setting. We are asking our technical partner for help. Yesterday, they did some change and caused our website cannot be accessed within our network but still can be accessd from outsite our network.

Thank you again. I will accept your solution after we fix our problem and let you know what causes the problem.
danmcfadden:

We still cannot figure out why only inside network emails were blocked when using clasic asp SMTP application to send email inside our network recently. I have to rewrite new application using asp.net to replace the clais asp application.  Is there any way to use other object instead of CDONTS.NewMail in clasic asp application to send email?

As I said before, I will accept your help even though your answer ddn't solve my problem.

Thanks a lot.
although solution didn't solve my problem, I was very happy with the help.
I would recommend using CDO.SYS instead of CDONTS.  CDO.SYS allows for sending email to a remote SMTP relay, removing the need to have an instance of SMTP on the Web Server.  The more you can remove from the web application server, the better and safer the server will be.

Here is code I use:

'***** Global delcarations
Const CdoBodyFormatHTML = 0
Const CdoBodyFormatPlainText = 1
Const CdoMailFormatMime = 0
Const CdoMailFormatText = 1
Const CdoEncodingUUencode = 0
Const CdoEncodingBase64 = 1
Const CdoLow = 0
Const CdoNormal = 1
Const CdoHigh = 2

'***** Send email
Sub SendMail(thisImportance, thisSender, thisRecipient, thisSubject, thisBody)
    Dim objEmail, strSendFile
    Set objEmail = CreateObject("CDO.Message")
    objEmail.From = thisSender
    objEmail.To = thisRecipient
    objEmail.Subject = thisSubject
    objEmail.HTMLBody = theBody
    With objEmail.Configuration
        .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="YourSmtpServerGoesHere!"
        .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Fields.Update
    End With
    objEmail.Send
    Set objEmail = Nothing
End Sub

'***** Main *****
Dim strImportance
Dim strSender
Dim strRecipient
Dim strSubject
Dim strBody

strImportance = CdoHigh
strSender = "you@youdomain.com"
strRecipient = "someone@somewhere.com; someoneelse@there.net"
strSubject = "VBScript CDO.SYS originated email"
strBody = "VBScript CDO.SYS originated email"
Call SendMail(strImportance, strSender, strRecipient, strSubject, strBody)

Wscript.Echo "Done"
Wscript.Quit

Hope this helps...
Thanks a lot. you are so kind.
I will try your suggestion.
IT WORKS GREAT!

THANKS