Re: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0

yelpframeΑσφάλεια

4 Νοε 2013 (πριν από 3 χρόνια και 5 μήνες)

89 εμφανίσεις

Re: "Failure Sending Mail" when using
System.Net.Mail and ASP.Net 2.0
Source:
http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.aspnet/2005-12/msg00711.html
From: "Daniel Fisher\(lennybacon\)" <info@xxxxxxxxxxxxxx>·
Date: Mon, 5 Dec 2005 13:15:14 +0100·
Have you tried to add the credentials to your web.config?
--
Daniel Fisher(lennybacon)
http://www.lennybacon.com
<HoustonComputerGuy@xxxxxxxxx> wrote in message
news:1133733236.253677.48600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I am working on getting my web applications moved to .Net 2.0 and am
> having some problems with System.Net.Mail. I get the following error
> when sending the mail:
>
> System.Net.Mail.SmtpException was unhandled by user code
> Message="Failure sending mail."
> Source="System"
> StackTrace:
> at System.Net.Mail.SmtpClient.Send(MailMessage message)
> at System.Net.Mail.SmtpClient.Send(String from, String
> recipients, String subject, String body)
> at emailtest.Page_Load(Object sender, EventArgs e) in ******
> at System.Web.UI.Control.OnLoad(EventArgs e)
> at System.Web.UI.Control.LoadRecursive()
> at System.Web.UI.Page.ProcessRequestMain(Boolean
> includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
>
> And the innerexception shows:
>
> "The token supplied to the function is invalid"
>
>
> My 1.1 application works fine with the settings below. Here is the code
> I am using in 2.0:
>
> Dim SmtpClient As New System.Net.Mail.SmtpClient
> SmtpClient.Host = "MAILSERVER"
> SmtpClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
Re: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0
Re: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0 1
> SmtpClient.Credentials = New
> System.Net.NetworkCredential("username", "pass")
> SmtpClient.Send("FROM", "TO", "Test Sub", "test Body")
>
> On my server I am running Kerio mailserver 6.1.1. I require
> authentication when sending SMTP. The usernames are in the format of
> username@xxxxxxxxxxxxxxx The SMTP server is on the standard port 25.
>
> I have seen similiar posts on the internet but no resolution. Why would
> this work in framework 1.1 and not in 2.0? And since I cannot find any
> 3rd party componenets for 2.0 yet, I am forced to work through this
> issue.
>
> Any help would be much appreciated.
>
.
Follow-Ups:
Re: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0
From: HoustonComputerGuy

·
References:
"Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0
From: HoustonComputerGuy

·
Prev by Date: Re: Can't edit, delete or add row in an Access database in a websi·
Next by Date: Re: how to migrate 1.1 project to 2.0?·
Previous by thread: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0·
Next by thread: Re: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0·
Index(es):
Date
Thread
·
Re: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0
Re: "Failure Sending Mail" when using System.Net.Mail and ASP.Net 2.0 2