View Single Post
  #3 (permalink)  
Old 21-11-2008, 18:44
stevell stevell is offline
new member
 
Join Date: Nov 2008
Posts: 3
Default

Can you tell me why that would help? I'm assuming its so that you can see the execption?

I have some more details after trying configuring it with localhost.

The code used to send the email:

MailMessage email = new MailMessage(to, from, subject, message);
email.IsBodyHtml = true;
SmtpClient cl = new SmtpClient();
cl.Host = "localhost";
cl.Send(email);

Also I have some other configuration in my web.config i found:

<system.net>
<mailSettings>
<smtp>
<network host="localhost" password='****' userName='*******' />
</smtp>
</mailSettings>
</system.net>

And lastly here is the ASP.NET exception I get:

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Net.Mail.SmtpException: User not local; please try a different path. The server response was: Sender address is not valid for your login. Check your email program settings. at System.Net.Mail.MailCommand.CheckResponse(SmtpStat usCode statusCode, String response) at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) at System.Net.Mail.SmtpClient.Send(MailMessage message) at SJL.SJLPhotographic.Utils.AbstractEmailSender.Send (String to, String from, String subject, String message) in d:\inetpub\vhosts\sjlphotographic.com\httpdocs\App _Code\Utils\AbstractEmailSender.cs:line 14 at SJL.SJLPhotographic.Utils.AdminEmailSender.Send(St ring to, String subject, String message) in d:\inetpub\vhosts\sjlphotographic.com\httpdocs\App _Code\Utils\AdminEmailSender.cs:line 19 at About.Page_Load(Object sender, EventArgs e) in D:\inetpub\vhosts\sjlphotographic.com\httpdocs\Abo ut.aspx.vb:line 8 at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.about_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e() at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
Reply With Quote