Cant send email using IIS but can with .net 2 development server...

We have a web app that sends email notices when a user clicks a button.
If I use the .net development server to run the pages, the email
notifications are sent, no problem. If I run the site under IIS, the
emails are not sent, and I get the following error:

An established connection was aborted by the software in your host machine

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.Sockets.SocketException: An established connection was aborted by the software in your host machine

Source Error:

Line 190:			{
Line 191: SmtpClient mailClient = new SmtpClient();
Line 192: mailClient.Send(mail);
Line 193: }
Line 194: //}

Any thoughts?

My email server is NOT the same as the web server.

0
glandgraf
5/27/2005 7:46:00 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

4 Replies
1356 Views

Similar Articles

[PageSpeed] 46

When you're mail server is different than the server you're running on there are two options for setting the mail server for .NET to use.  The first way is to put a section in the web.config inside of the <configuration> node like this:

 <system.net>
  <mailSettings>
   <smtp deliveryMethod="Network">
    <network host="mymailserver.net" port="25" from="
webmaster@mysite.com"/>
   </smtp>
  </mailSettings>
 </system.net>


You can also set the server property on the SmtpClient like this:

SmtpClient mailClient = new SmtpClient();
mailClient.Host = "mymailserver.net";
mailClient.Send(mail);

Hope this helps

Rich Czyzewski

Software Architect
Jacksonville, Florida

Check out my .NET 2.0 Website WebJots (Starter Kit Available)
My Blog - Beta 2 Stuff, ASP.NET, etc.

0
Rich21
5/28/2005 3:19:10 AM
We have the web.config setup as follows:

<system.net>
        <mailSettings>
            <smtp deliveryMethod="Network">
                <network from="iamsam@gocfi.com"
                    host="chiemail2.gocfi.com"
                    port="25"
                    defaultCredentials="true" />
            </smtp>
        </mailSettings>
    </system.net>

The mail sends fine when running the site locally - using the built in ..net development web server, but returns the error stated in the initial post when trying to use IIS...

0
glandgraf
5/31/2005 11:49:03 AM
I was having a similar problem but traced it to McAfee v8, which had a
default option to "prevent mass mailing worms from sending
email".  Unchecked, emails work fine now.
0
theurbandude
6/7/2005 3:47:39 AM
Problem solved. I had to switch to the IP address of the box, as the server name wasn't registered in the DNS entry
0
glandgraf
6/7/2005 11:41:57 AM
Reply:

Similar Artilces:

Can we deploy a .net 1.1 app to a .net 2.0 server?
Hi, We have been hosting an app on a server that has ASP and ASP.net 1.1 support.  We are now moving to an ISP that has ASP, ASP.net 1.1 and ASP.Net 2.0 plans.  We will soon migrate the development environment to VS 2005.  However, today we use VS 2003.  My question is can we initially deply to a server that has .net 2.0 support?  Are the 2.0 libs fully backward compatible? jerry    You can deploy a 1.1 app to a server runnuing both 1.1 and 2.0 by setting the framework version for the application on the server.  You can deploy many (bu...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Migration from .net 1.1 to .net 2.0 and deployed in server: error "Server Application Unavilable"
Hi, I have upgraded one .net 1.1 application to .net 2.0. though locally the application is running fine, when deployed in the server it is giving the following error : Server Application Unavailable The web application you are attempting to access on this web server is currently unavailable.  Please hit the "Refresh" button in your web browser to retry your request. Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused thi...

How to get new web app to use .NET 2.0 on Win2K server using .NET 1.1 as default framework?
I have .net framework1.1 and 2.0 on our server running win2K. i have existing applications that uses asp.net 1.1, i also have a new app that use ASP.net 2.0.  how can i set my new .NET 2.0 app to point to asp.net 2.0 without messing up my existing .NET 1.1 apps? To specify the ASP .Net version fro a web application, do the followingIn IIS Manager select the web application -> Properties -> ASP.Net TabSelect  ASP.Net version you want to use for the applicationRegards,PrashantDont forget to click "Mark as Answer" on the post that helped you. But I am running Win2K...

Send email in .net 2.0 using C#
hi can someone please let me how to send emails with attachments in .net 2.0 using C# Some code an explainations in the first few hits ofhttp://www.google.com/search?complete=1&hl=en&q=system.net.mail"If you make it idiot proof, they'll build a better idiot"...

Can not send email in aps.net 2.0
While I sending email, it will throw exceptin, but sometimes it is ok, I don't know whyException:Client does not have permission to submit mail to this server. The server response was: 5.7.3 Client does not have permission to submit mail to this server.My code: public static void SendEmail()        {            MailMessage message = new MailMessage();            message.From = new MailAddress("zhihao@ncsi.com.cn");     &nbs...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

Can anybody help with Pros and Cons of .net beta 2.0 for using Mobile.Net
Hi,      I am New to Mobile.Net, can anybody help me in deciding which framework should i use for my application .Net 1.1 Or .Net 2.0 Beta.      Also Some guidelines about How to use it will really appreciated.   Thanks in advance Imrant 1.1 has a separate application for mobile controls; you create one website for your regular application and one for mobile applications.  In 2.0 beta, that bridge is crossed where you don't have to create two web sites; it uses adapters to render the controls differently in each brows...

Cross-Platform .NET Development: Using Mono, Portable.NET, and Microsoft .NET
Interesting book I came across: Cross-Platform .NET Development $49.99 doesn't hurt too much either :) NOTE: Availability: This item has not yet been released. You may order it now and we will ship it to you when it arrives. It's being released on September 30th, 2004 - one to keep an eye on...www.codingmayhem.com - VB.NET, C#, Silverlight, Javascript, HTML, CSS, T-SQL, MySQL and SQLitewww.headshotgamer.com - Gaming News and Reviews How about this book from Oreilly? Mono: A Developer's Notebook http://www.oreilly.com/catalog/monoadn/...

Net framework 2.0 installled on my server, can i replace it with .net framework 3.5
Hi all I have .Net framework 2.0 installled on my server,  and  websites are currently running  that are developed in .net 2.,  my  clinets wants .net framework 3.5 or  if i installed .net framewrok 3.5 in my server, there is any problems to my previous  web application that was hosted using .net framework 2.0   if yes ,how  can i installed .net framewrok 3.5 adilahmed Don't worry...just install it. .net 3.5 is incremental and works on top of 2.0. Any existing websites will reference the 2.0 binaries and will still work.   Also, I...

Develop in .NET 3.5...Deploy on .NET 3.0...Assembly strong name issue in web.config
Hi. I develop locally using web developer express 2008. I have .NET 3.5 installed on the development machine.I am trying to deploy to a Windows Server 2003 machine running.NET 3.0.Not surprisingly, I get an error about the strong assembly names referenced all over my web.config when I try to access the site on the production server.I don't think any of my code truly relies on .NET 3.5--it should all be compatible with the 3.0 framework.Here's my error message:Parser Error Message: Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

About: how can i send a MIME(Text und Html Format) Mail by System.Net.Mail und .Net 2.0
Helle to all, I hope that someone can help me. I need to implement a programm to send newsletters. The newsletter Format can be Html, Text and MIME(Html and Text). when using CDONTS library man can set MailFormat = MIME. But i use System.Net.Mail and there are only text or html Format. Can someone tell me how can i use System.Net.Mail to send a MIME Mail? Thanks Best Regards Pinsha perhaps this link can help:  http://systemnetmail.com/faq/3.1.3.aspxIn this world there are 10 types of people, those that know binary and those who don't....

cannot send email from webpage using System.Net.Mail on external smtp server
Every time I am trying to send email from my webpage, or using passwordrecovery tool , i get following error :: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed I went through all the existing posts, but none of them worked for me. I have already checked http://www,systemwebmail.com/ web.config settings are as follows <system.net>    <mailSettings>      <smtp from="noreply@allure.com"&g...

Web resources about - Cant send email using IIS but can with .net 2 development server... - asp.net.config-deploy

Agile Software Development - Better ways of developing software
- All things cross-platform, mobile, and mobile-web. Especially Qt/QML related - I love developing software, but also practice managing projects ...

United States Department of Housing and Urban Development - Wikipedia, the free encyclopedia
Robert C. Weaver Federal Building , 451 7th Street SW , Washington, D.C. 38°53′2.17″N 77°1′21.03″W  /  38.8839361°N 77.0225083°W  / 38.8839361; ...

Mehajer stands down from development roles
THE controversial deputy mayor of Auburn, Salim Mehajer, has stood down as director from six of his seven property development companies and ...

Software Development Linkopedia November 2015
... programming, software testing and project management. This month you will find some interesting information and opinions about software development ...

Google-owned Nest sets up Kirkland development office
Google-owned home automation platform Nest Labs, Inc. is expanding to the Seattle area, a company spokeswoman said Monday. Nest, which Google ...

Today in bad ideas: A ‘Memento’ remake is in development
... but that's apparently a long enough period for a remake to be considered. Yes, seriously — a remake of Nolan's 2000 film is soon to be in development, ...

Lockheed Martin’s Sikorsky acquisition could speed development of autonomous helicopters
Lockheed Martin announced earlier this month that it is acquiring Sikorsky Aircraft, the maker of the Black Hawk helicopter, for $9 billion. ...

Paris attacks investigation: Latest developments
CNN Paris attacks investigation: Latest developments CNN Our Terms of Service and Privacy Policy Have Changed. By using this site, you agree ...

Felger: ‘Huge development’ Amendola came on last year
... Login Search form Search 36° Main menu Home Celtics Patriots Red Sox Bruins Revolution More WRITERS Watch Shop NECN Felger: ‘Huge development’ ...

Deal: Pay What You Want for the JavaScript Development Bundle
For a limited time on the DL Deals Store , you can grab a JavaScript Development Bundle through a name-your-own-price deal. Inside this bundle, ...

Resources last updated: 11/21/2015 6:04:41 PM