[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


SMTP error on my ASP.Net page

Posted on 2006-05-09
Medium Priority
Last Modified: 2008-01-09
Hello, I am having a problem with my SMTP server relay. I am using ASP.Net and godaddy.com for my server. All the functions I write that sends an email to my user give me the same error and I know the coding is currect. Does anyone have any idea whats happening?

The error I am getting is below. Thanks

The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for ryan@knightswap.com
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for ryan@knightswap.com

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[COMException (0x8004020f): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for ryan@knightswap.com

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
   System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
   System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
   SpeedyNotes.Register.btnSave_Click(Object sender, EventArgs e)
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1292

Question by:cwitr329
LVL 27

Expert Comment

ID: 16645119
you are probably foget to authenticate against mail server before sending the message.

Expert Comment

ID: 16649091
Check out this page for some pointers on 0x8004020f errors


Accepted Solution

chhokra_expert earned 2000 total points
ID: 16660090
i agree with Nopius. probably you are not "logging" on the SMTP server. most SMTP servers don't allow relaying for unknown clients. you can "login" by using one of the SMTP extensions (e.g. AUTH LOGIN) or using POP before SMTP (depending on your ISP).

quoting http://www.aspfaq.com/show.asp?id=2026#auth (it has other useful information after it as well)

If you get "8004020E" or "80040211" errors, and you are using a remote SMTP server, make sure that you can establish a telnet session on the SMTP server from the web server, that the SMTP server is configured to allow SMTP relay, and that it doesn't require outgoing SMTP authentication. If it requires outgoing authentication, you may need to use the commercial version of ASPEmail, or another component that supports outgoing SMTP authentication. You can send e-mail to an SMTP server requiring outgoing authentication with CDO using the following code:

    NAME="CDO for Windows 2000 Library"
    Set cdoConfig = CreateObject("CDO.Configuration")  
    With cdoConfig.Fields  
        .Item(cdoSendUsingMethod) = cdoSendUsingPort  
        .Item(cdoSMTPServer) = "<enter_mail.server_here>"  
        .Item(cdoSMTPAuthenticate) = 1  
        .Item(cdoSendUsername) = "<enter_username_here>"  
        .Item(cdoSendPassword) = "<enter_password_here>"  
    End With
    Set cdoMessage = CreateObject("CDO.Message")  
    With cdoMessage
        Set .Configuration = cdoConfig
        .From = "from@me.com"
        .To = "to@me.com"
        .Subject = "Sample CDO Message"
        .TextBody = "This is a test for CDO.message"
    End With
    Set cdoMessage = Nothing  
    Set cdoConfig = Nothing  

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question