473,695 Members | 2,587 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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="Failur e sending mail."
Source="System"
StackTrace:
at System.Net.Mail .SmtpClient.Sen d(MailMessage message)
at System.Net.Mail .SmtpClient.Sen d(String from, String
recipients, String subject, String body)
at emailtest.Page_ Load(Object sender, EventArgs e) in ******
at System.Web.UI.C ontrol.OnLoad(E ventArgs e)
at System.Web.UI.C ontrol.LoadRecu rsive()
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)

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.Deli veryMethod = Net.Mail.SmtpDe liveryMethod.Ne twork
SmtpClient.Cred entials = New
System.Net.Netw orkCredential(" 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
us******@domain name.com. 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.

Dec 4 '05 #1
3 57650
Have you tried to add the credentials to your web.config?

--
Daniel Fisher(lennybac on)
http://www.lennybacon.com
<Ho************ ****@gmail.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
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="Failur e sending mail."
Source="System"
StackTrace:
at System.Net.Mail .SmtpClient.Sen d(MailMessage message)
at System.Net.Mail .SmtpClient.Sen d(String from, String
recipients, String subject, String body)
at emailtest.Page_ Load(Object sender, EventArgs e) in ******
at System.Web.UI.C ontrol.OnLoad(E ventArgs e)
at System.Web.UI.C ontrol.LoadRecu rsive()
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)

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.Deli veryMethod = Net.Mail.SmtpDe liveryMethod.Ne twork
SmtpClient.Cred entials = New
System.Net.Netw orkCredential(" 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
us******@domain name.com. 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.

Dec 5 '05 #2
I hadn't tried that so I just tried using the following in my
web.config. No go though, got the same error. On a side note I can send
through gmail's smtp service using their alternate port and SSL.
Although in my cirumstance I am just trying to send a regular email
using authentication.

<system.net>
<mailSettings >
<smtp deliveryMethod= "network" from="us**@doma in.com">
<network
host="localhost "
password="****"
userName="us**@ domain.com"
port="25"
/>
</smtp>
</mailSettings>
</system.net>

Dec 5 '05 #3
Try looking for a solution at:-
http://www.systemwebmail.com/
It should guide you
Patrick

"HoustonCompute rGuy" <Ho************ ****@gmail.com> wrote in message
news:11******** ************@g4 9g2000cwa.googl egroups.com...
I hadn't tried that so I just tried using the following in my
web.config. No go though, got the same error. On a side note I can send
through gmail's smtp service using their alternate port and SSL.
Although in my cirumstance I am just trying to send a regular email
using authentication.

<system.net>
<mailSettings >
<smtp deliveryMethod= "network" from="us**@doma in.com">
<network
host="localhost "
password="****"
userName="us**@ domain.com"
port="25"
/>
</smtp>
</mailSettings>
</system.net>

Dec 6 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
29103
by: Steven K | last post by:
Hello, I am using an asp page (upload.asp) to gather information and to upload files to the web server using SoftArtisans SAUpload Tool. In the first page (upload.asp), I have a form for gathering info with the following: <form method="POST" action="upload_ok.asp" name="frmUpload" enctype="multipart/form-data"> <input type="hidden" name="cmdSearch" value="SearchValue"> <input type="hidden" name="cmdName" value="NameValue">
10
5624
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I create a single View and specify also in this View the WHERE clause that is common in these stored procedures, I will have the new stored procecures changed to be like:
8
4425
by: Just Me | last post by:
1)How can I find the folders like "My Recent Document", "Desktop", "My Pictures",... if I want to store a file there? 2) How can I find the icon for those files if I want to display it? Thanks in advance for any helpful suggestions
2
2919
by: JohnB | last post by:
hi I am using System.Web.Mail.MailMessage to send email. Is there any way to keep the email to "Sent Items" Folder?? I use Microsoft Outlook as my email tool. Thanks
5
10327
by: Mike Logan | last post by:
I used WSDL.exe to generate a client side web proxy for a web service, called the web service, got the results but an array returned by the web service is not in the results. However if I use "Add Web Reference" for the same service the same function works appropriately. Here is the client proxy generated from WSDL.exe <System.Web.Services.Protocols.SoapDocumentMethodAttribute("capeconnect:AppSec:AppSecPortType#getApplicationUsers",
94
30298
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock Statement (C# Reference) statement to serialize access. " But when is it better to use "volatile" instead of "lock" ?
0
1596
by: Hollywood | last post by:
Good day dear members of the comp.databases.ms-access newsgroup. I'm using the new Acess 2007 "Collect data by using e-mail messages" functionality but it seems the generated e-mail by Outlook 2007 does not support the html list of fields feature. Instead all the options of my lists are displayed at e-mail bottom. Please is there any solution to this problem ?
2
2575
by: shil | last post by:
Hi all, I'm using System.Net.Mail (Framework 2.0) to send emails on scheduled basis. This works great on Windows 2000 server. Rently we have upgraded our servers to Windows 2003. Since then some of the emails are failing from being sent to people. Ratio is like 1 in 30 are being failing, I thought it is the mail size issue and I have unchecked the mail size limit on SMTP server. Still I couldn't figure out why few are not going out.
1
3054
by: =?Utf-8?B?VGFsYWxTYWxlZW0=?= | last post by:
i have facility in my website which sends an e-mail to the cleint's inbox..... i am getting a problem when ever i sends an e-mail.. i tried with Hotmail and Yahoo, e-mail goes to the "Junk Mail" folder not the actual inbox.... how i can get e-mail sent the clients inbox not in their "Bulk" or "Junk Mail" box thanks my send e-mail page C# codes are below:
0
8616
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8552
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9110
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8818
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7650
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5825
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.