Thursday, March 29, 2012

Newbie : SMTP Problem

Hi,

I'm a newbie in programming. I have started working on ASP.Net this week. My OS is Windows XP Profesional. IIS 5.1, Visual Studio 2005. I am trying to build a simple user login system from the book "ASP.Net 2.0 Everyday Apps for DUMMIES". I followed every instruction written in the book. Everything is working well apart from sending email to the user while registering or changing password.

Can anyone help me please. Thanx in Advance,

Portion of webconfig file is below:

<system.net>
<mailSettings>
<smtp>
<network host="localhost" port="25" />
</smtp>
</mailSettings>
</system.net>

The error I'm getting is below.

Server Error in '/UserLoginCS' Application.

Mailbox unavailable. The server response was: 5.7.1 Unable to relay forcupidoly@dotnet.itags.org.gmail.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.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay forcupidoly@dotnet.itags.org.gmail.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:

[SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for cupidoly@dotnet.itags.org.gmail.com] System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +704 System.Net.Mail.SmtpClient.Send(MailMessage message) +2184 System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +482 System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +639 System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +199 System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +649 System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +157 System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +39 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +107 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +178 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +72 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Is your PC a email server?If not,you should set a email server in web.config.Besides,can you paste some codes about how do you send emails?

I'm also getting the same error. This error only occurs when email address does not exists.

Error displayed: Server Error in '/' Application. ------------------------ Runtime Error Mailbox unavailable. The server response was: 5.1.1 User unknown 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.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.1.1 User unknown 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: [SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.1.1 User unknown] System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +800307 System.Net.Mail.SmtpClient.Send(MailMessage message) +2004 System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email, String userName, String password, MailDefinition mailDefinition, String defaultSubject, String defaultBody, OnSendingMailDelegate onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate, Control owner) +341 System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +571 System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) +105 System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +453 System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) +149 System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +17 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +171 System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

0 comments:

Post a Comment