473,746 Members | 2,381 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 57667
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
29114
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
5636
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
4430
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
2921
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
10336
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
30334
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
1599
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
2577
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
3057
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
8975
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
8801
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
9516
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...
0
9351
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6774
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4587
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4840
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2200
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.