Email Problems Upon Deploying an Application

Hi there!

I am developing a web application that at some point sends an email.  The system is being developed in VB.NET.
Everything works perfectly in the Visual Studio 2005 test environment.  Emails are being sent properly to our SMTP server (hosted on the internet).

Now that I've deployed the web application (onto an IIS 5.1 server), my emails are not being sent.

I am catching an SmtpException with a status code of "General Failure".
The exception message is: "The operation has timed out.    at System.Net.Mail.SmtpClient(MailMessage message".

I am providing user credentials to connect to the SMTP server.  I have copied my code into a desktop application to test and make sure there's nothing wrong with it.  The test desktop application works without any this isn't a matter of supplying credentials or trying to send on the wrong port.

I've tried absolutely everything to get this to work!

I'm sure that there's a problem with the way the web server is configured...

Just in case you don't think it's a server error the following function is responsible for sending the email:

1      Private Function sendEmail() As Boolean
2                'Function Description: 
3                '   This function is responsible for sending the the email message.
4                '   ->  It creates a new mail message and fills in its information.
5                '   ->  It calls the compileEmailMessage to create the body of the email
6                '       with the appropriate content for the email.
7                '   ->  It then sends the email
8                'Paramaters:
9                '   None.
10               'Return Value:
11               '   True if the email was sent successfully, otherwise false.
13               Dim retval As Boolean
14               retval = False
15               Try
16                   Dim emailTitle As String = ""
17                   If fault Then
18                       emailTitle = "Online Registration Error Occured"
19                   ElseIf MaxNumSubmissionsExceeded = True Then
20                       emailTitle = "Customer Experienced Problems With Registration"
21                   Else
22                       emailTitle = "Software Re-Registration Request"
23                   End If
25                   Dim emailMessage As Net.Mail.MailMessage
26                   Dim body As String = compileEmailMessage()
28                   emailMessage = New Net.Mail.MailMessage("", "", emailTitle, body)
29                   Dim mailClient As New Net.Mail.SmtpClient("", 26)
30                   Dim myCredentials As New System.Net.NetworkCredential(System.Configuration.ConfigurationManager.AppSettings("EmailUserName"), System.Configuration.ConfigurationManager.AppSettings("EmailPassword"))
32                   mailClient.UseDefaultCredentials = False
33                   mailClient.Credentials = myCredentials
34                   mailClient.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
36                   mailClient.Send(emailMessage)
37                   retval = True
38               Catch ex As System.Net.Mail.SmtpException
39                   retval = False
40                   Dim status As System.Net.Mail.SmtpStatusCode = ex.StatusCode
41                   Dim errorMessage As String = "SmtpException Status ->" + status.ToString + ". Error: " + ex.Message + " " + ex.StackTrace
42                   If Not ex.InnerException Is Nothing Then
43                       errorMessage = errorMessage + " InnerException: " + ex.InnerException.Message + " " + ex.InnerException.StackTrace
44                   End If
46                   DatabaseHandler.RecordError(errorMessage)
47               Catch ex As Exception
48                   DatabaseHandler.RecordError(ex.Message + " " + ex.StackTrace)
49               End Try
50               Return retval
51           End Function

I am anxiously waiting for your thoughts on my problem!
I've been stuck on this way too long.



6/15/2007 2:03:56 PM 91979 articles. 3 followers. Follow

6 Replies

Similar Articles

[PageSpeed] 21

Check firewalls or other securtiy software.  Check the SMTP logs to see if the connection was ever made.


Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
6/15/2007 2:40:09 PM

Thank you for your quick reply Jeff!

I think I forgot to mention that I'm connecting to a remote SMTP....I cannot check the SMTP logs.
I've been running without firewall this whole time I've been trying to solve this problem.

Do you have any other suggestions?



6/15/2007 2:55:38 PM

I am still stuck on this problem.
I've tried using another email provider and the same thing happens:

I'm able to connect and send an email in my Visual Studio development environment but I am unable to do so on the IIS server (which is the same computer).

I'm looking forward to hearing anyone's thoughts on the issue.
I still believe that there is a setting in IIS that I'm over looking.

Thank you for your time!


6/18/2007 1:43:23 PM

The primary difference between the two is the user account the ASP.NET process runs under.  In the dev server it's the logged in user, often an administrator.  In IIS, it's the ASP.NET process account or the anonymous user account.


Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
6/18/2007 2:42:14 PM

Do you have any hint as to how to configure the IIS's ASP.NET process account (anonymous user account) so that it is permitted to send emails?

6/18/2007 3:05:45 PM

 The problem was fixed yesterday after porting my web application to the server to prove to an IT guy that it wasn't which time it suddenly started working.  After pondering the reason why, we concluded that the router changes that opened port 26 didn't take effect until after we had shut everything down for the weekend...

 I was attempting to solve the problem on a development server before I started configuring our production server and was continuously being stopped by our all my attempts were in vein.

For those of you stuck on this problem, take Jeff's advice here and check to make sure that your network security isn't preventing your emails from being sent...check your firewall settings, router settings, proxy settings (if you have one), and definitely your anti-virus settings too.


Thanks for your help Jeff!


6/19/2007 1:30:07 PM

Similar Artilces:

getting problem in deploy the >net WebForm application on 3rd party host server
Hi every body, I have deployed successfully a pb 11.5 application to .Net WebForm. But i don't know how to deploy it in 3rd party Host server. Can u give me the dll list , help me my explaining me the step to do it . There's a chapter in the "Deploying Applications and Components to ..Net" called "Deploying and running a .NET Web Forms project" that contains instructions for that: On 18 Sep 2009 07:53:41 -0700, chinmaya wrote: >Hi every bod...

Getting started with .net mobile/wireless application programming
Hi friends, I am very much amateur to the world of mobile/wireless application programming that's why m is having thousands of doubts and confusion regarding the technology. My first few concerns about the terms i.e. mobile web applications vs. windows mobile applications first thing are these 2 things are same if not what are the main differences. I hope you will also show me some light how to move further ahead in this field as i m having small exp approx. 1.5 yrs in application. Any help in the form of links, URL, code will be highly appreciated. Thanks in advanced...

emails not getting sent after deploying web application on the server
i have an intranet website which sends emails after some actions. When through debug mode in VS 2005, the mail is sent. But after it is deployed on the server in IIS, i get an exception '550 5.7.1 client does not have permissions to submit to this server.' I checked the settings for the account (exchange server) which has send permissions. Do i need some special settings on IIS or SMTP service or change to my code? Check the Relay and Authentication settings in the IIS Console, of local SMTP Server. When the going gets tough - the tough gets going---------...

Problems while deploying a .net 2.0 application on test server
Hi Guys, --------1) I am tryig to install .net 2.0 application by creating MSI Installer exe. While installing it is giving me these below ERRORS in log files. But I am not getting any problem in installing my application and I am successfully able to install my application completely. Still I don't want these error in my logfile as it can affect on other environment. Please help me out and let me know the cause of these error asap. I am stuck up in between. DEBUG: Error 2769:  Custom Action WEBCA_EvaluateURLs did not close 2 MSIHANDLEs.The installer has encountered an unexpected...

Problems while deploying a .net 2.0 application on test server
Hi Guys,  --------1) I am tryig to install .net 2.0 application by creating MSI Installer exe. While installing it is giving me these below ERRORS in log files. But I am not getting any problem in installing my application and I am successfully able to install my application completely. Still I don't want these error in my logfile as it can affect on other environment. Please help me out and let me know the cause of these error asap. I am stuck up in between. DEBUG: Error 2769:  Custom Action WEBCA_EvaluateURLs did not close 2 MSIHANDLEs.The installer has encountered an ...

Starting an Application in .net
i am new to could any one give me simple ajax,net example so that i start building on my ajax skills please.........  I started with the todolist video on the main page, and its all you need to know to get started. Don't forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.    ...

getting email account of a particular user of outlook express in to .NET application..
Hi,  I want to retrieve the  a particular user email account of outlook express in to my .net application.Please help me. Hi, Based on my experience, if you develop a windows application, I suggest to use "Linq" to get the particular user accounts. Please refer to the following code. .cs file import the namespace using Microsoft.Office.Interop.Outlook;            _Application outlook = new Microsoft.Office.Interop.Outlook.Application();           &nb...

Deploying .Net application with datawindow .Net objects
Hi I=92ve been testing datawindow .net for our company by building a small working application using the Datawindow .Net tutorial. It works great (both from the VS interface and the compiled solution .exe) and was easy to create. My next test is to try and deploy this application to another machine, which has the .Net (1.1) environment but no Powerbuilder or Visual Studio. I built my solution and placed these files, all in one folder, on this other machine: datawindow.dll datawindow.xml DataWindowInterop.dll MSVCP71.DLL MSVCR71.DLL PBDATA100.dll PBDWN100.DLL PBO10100.D...

Deploying powerbuilder application as .NET web application
Hi when I deploy Client/Server PowerBuilder application as .NET Web application I get below output. Not even getting any bug messages. Checking IIS Server... Generating .NET assembly file... Deploy failed. Have deployed provided Tutorial application as Web application. It has successfully created and deployed. Any information is appreciated. If this question has to do with PB 11 WebForm deploys, you want to post it in the section. This section is for DataWindow.Net, a different product. On 29 Jul 2008 05:32:55 -0700, Raju Gol...

Problems while porting .Net framework 1.0 (VB.Net) application to .Net Framework 1.1
Hello,   I have a ASP.Net web application,written in VB.Net,developed on .Net Framework 1.0 .I am trying to port it on to .Net framework 1.1.   For achieving this,I follow the following steps-   1.Open the project using the .vbproj file. 2.I am prompted with the conversion message "Do you want to convert the solution and all projects to .Net framework  1.1....." 3.I click "Yes" 4.I assume that the project is now converted. 5.I build the project & try to run it. 6.I get the following error -     Server Error in '/Consert.Net' Application. ...

Problem Getting Started
In have run the 1317set.bat file and still get the following error: Unable to get your db version please run version script against your db and restart your web application (go to update/scripts/ folder and run 1317set.bat). Any help to get me started would be much | Have you checked your connection string? This is sometimes caused by a faulty db connection. I am new to Rainbow and get the same error when trying to run it for the first time. Does not matter which of the following I comment out in web.config: <!-...

.Net Application generators
There are a few .Net complete n-tier application generators that generate directly from your database. Some even have their own database building tools. They are great and easy to follow and their applications generate real VB.Net and C# code, easy to learn. These are great starts for .Net stuff except for one thing, PRICE. Iron Speed is about $1500 and for the same exact product features ASPNetNow sells for only $279 for their Web Matrix version or $530 for VS version. Another company Avalanche sells for $995. Amazing price ranges. The first two match feature for feature except the first yo...

Getting "Problem in Mapping Fragment starting at line ..." error when trying to create table mappings for table associations in ADO.NET Entity Framework

Deploy .Net application with datawindow .net 1.0 on win98
Hello I had tried to install an application with datawindow .net on win98. I can install but application don t run ... Is it right? Do DW .Net works on win98 ? Thank you. Ste DataWindow .NET Product specifications Supported Operating System * Windows 2000 Professional (SP3 or later) * Windows 2000 Server (SP3 or later) (for deployment only) * Windows XP with service pack 1 On 1 Apr 2005 00:01:38 -0800, Stefano Trotti wrote: >Hello >I had tried to install an applic...

Web resources about - Email Problems Upon Deploying an Application -

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

The Bachelor 2016 application process can get explicit - Laurina Fleure
CHANNEL Ten is calling on singles to sign up for a chance to find love on The Bachelor , but willing applicants have to open a lot more than ...

Perth man’s Afghan wife slapped with 10-year visa application ban - PerthNow Search Search
A MAN’S three-year struggle to have his wife live with him in Australia has ended in heartache after his spouse was slapped with a 10-year ban. ...

MBA: Mortgage Applications Decrease in Latest MBA Weekly Survey, Purchase Applications up 24% YoY
From the MBA: Mortgage Applications Decrease in Latest MBA Weekly Surve Mortgage applications decreased 3.2 percent from one week earlier, according ...

Elon Musk Requests Applications For Autopilot Software Engineers On Twitter
... and more quickly achieve “generalized full autonomy.” So, if you ever wanted to work for Tesla in such a [&hellip Elon Musk Requests Applications ...

Mortgage applications fall 3.2%
A definitive rise in mortgage interest rates over the last month is keeping borrowers at bay.

Help wanted: Obama's tech-training project now accepting applications
Organizers of innovative training programs can now apply for a federal grant to help prepare low-wage workers for more-lucrative tech jobs.

Number Of Daily Applications To French Military TRIPLES Overnight
Number Of Daily Applications To French Military TRIPLES Overnight

PCB firm Unitech looks to automotive, IoT applications for 2016 growth
PCB maker Unitech Printed Circuit Board expects demand for any-layer designs for use in automotive electronics, wearables and other IoT-connected ...

Windows 10’s broken fall update removes user-installed applications without asking first
Microsoft's latest Windows 10 update is causing problems for at least some users, and uninstalling programs without the user's consent or evidence ...

Resources last updated: 12/1/2015 2:10:29 AM