473,699 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does System.Web.Mail work in development and not in production?

Hi,

I've posted this question before but didn't get anywhere with it.
Please help me out if you know of a solution for it.

I got "InnerException : Unable to connect to remote server"..."No
connection could be made because the target machine actively refused
it" when I attempted to send an email through my Intranet app that is
written in asp.net 2.0. The smtp server is a local server and it uses
Port 25. The Authentication is set to Anonymous Access. I tried
pointing to the SMTP gateway on my Exchange server and I ran into the
same problem. My organization uses Mcafee 8.5i. Does that have to do
with anything? Here's my code:
<system.net>
<mailSettings >
<smtp>
<network host="10.162.22 .72" />
</smtp>
</mailSettings>
</system.net>
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
Const ToAddress As String = "some...@somewh ere.com"
Dim mm As New MailMessage(Use rsEmail.Text, ToAddress)
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False
Dim smtp As New SmtpClient
smtp.Send(mm)
End Sub
In the <network host.. /section, I did not specify a username and
password because I set the smtp server authentication mode is set to
Anonymous Access. Can someone please tell me what I did wrong? I
couldn't find anything on the Web that could point me in the right
direction.
Thanks,
Jon

Sep 5 '07 #1
9 2317
"Homer" <Ho*******@gmai l.comwrote in message
news:11******** *************@r 29g2000hsg.goog legroups.com...
My organization uses Mcafee 8.5i. Does that have to do with anything?
Could be - McAfee is know to cause problems with System.Web.Mail :
http://www.google.co.uk/search?sourc...%2eMail+McAfee

BTW, why are using System.Web.Mail and not System.Net.Mail ...? Are you stuck
on ASP.NET v1.1...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 5 '07 #2
On Sep 5, 3:59 pm, "Mark Rae [MVP]" <m...@markNOSPA Mrae.netwrote:
"Homer" <HomerS...@gmai l.comwrote in message

news:11******** *************@r 29g2000hsg.goog legroups.com...
My organization uses Mcafee 8.5i. Does that have to do with anything?

Could be - McAfee is know to cause problems with System.Web.Mail :http://www.google.co.uk/search?sourc...hl=en-GB&ie=UT...

BTW, why are using System.Web.Mail and not System.Net.Mail ...? Are you stuck
on ASP.NET v1.1...?

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
My bad, typo. I'm using System.Net.Mail . Unfortunately, I don't have
access to the McAfee VirusScan Console to add the W3wp.exe to the
exclusion list. Do you know if that would fix it?

Sep 5 '07 #3
"Homer" <Ho*******@gmai l.comwrote in message
news:11******** *************@1 9g2000hsx.googl egroups.com...
My bad, typo. I'm using System.Net.Mail .
Grrrrrrr....! ;-)
Unfortunately, I don't have access to the McAfee VirusScan Console
to add the W3wp.exe to the exclusion list. Do you know if that would fix
it?
Yes, almost certainly...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 5 '07 #4
re:
!I got "InnerException : Unable to connect to remote server".

Can you ping 10.162.22.72 from the box which hosts the mail code ?


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========
"Homer" <Ho*******@gmai l.comwrote in message news:11******** *************@r 29g2000hsg.goog legroups.com...
Hi,

I've posted this question before but didn't get anywhere with it.
Please help me out if you know of a solution for it.

I got "InnerException : Unable to connect to remote server"..."No
connection could be made because the target machine actively refused
it" when I attempted to send an email through my Intranet app that is
written in asp.net 2.0. The smtp server is a local server and it uses
Port 25. The Authentication is set to Anonymous Access. I tried
pointing to the SMTP gateway on my Exchange server and I ran into the
same problem. My organization uses Mcafee 8.5i. Does that have to do
with anything? Here's my code:
<system.net>
<mailSettings >
<smtp>
<network host="10.162.22 .72" />
</smtp>
</mailSettings>
</system.net>
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
Const ToAddress As String = "some...@somewh ere.com"
Dim mm As New MailMessage(Use rsEmail.Text, ToAddress)
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False
Dim smtp As New SmtpClient
smtp.Send(mm)
End Sub
In the <network host.. /section, I did not specify a username and
password because I set the smtp server authentication mode is set to
Anonymous Access. Can someone please tell me what I did wrong? I
couldn't find anything on the Web that could point me in the right
direction.
Thanks,
Jon

Sep 5 '07 #5
On Sep 5, 4:28 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e:
re:
!I got "InnerException : Unable to connect to remote server".

Can you ping 10.162.22.72 from the box which hosts the mail code ?

Juan T. Llibre, asp.net MVP
asp.net faq :http://asp.net.do/faq/
foros de asp.net, en español :http://asp.net.do/foros/
=============== =============== ========

"Homer" <HomerS...@gmai l.comwrote in messagenews:11* *************** *****@r29g2000h sg.googlegroups .com...
Hi,
I've posted this question before but didn't get anywhere with it.
Please help me out if you know of a solution for it.
I got "InnerException : Unable to connect to remote server"..."No
connection could be made because the target machine actively refused
it" when I attempted to send an email through my Intranet app that is
written in asp.net 2.0. The smtp server is a local server and it uses
Port 25. The Authentication is set to Anonymous Access. I tried
pointing to the SMTP gateway on my Exchange server and I ran into the
same problem. My organization uses Mcafee 8.5i. Does that have to do
with anything? Here's my code:
<system.net>
<mailSettings >
<smtp>
<network host="10.162.22 .72" />
</smtp>
</mailSettings>
</system.net>
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
Const ToAddress As String = "some...@somewh ere.com"
Dim mm As New MailMessage(Use rsEmail.Text, ToAddress)
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False
Dim smtp As New SmtpClient
smtp.Send(mm)
End Sub
In the <network host.. /section, I did not specify a username and
password because I set the smtp server authentication mode is set to
Anonymous Access. Can someone please tell me what I did wrong? I
couldn't find anything on the Web that could point me in the right
direction.
Thanks,
Jon- Hide quoted text -

- Show quoted text -
Yes I could ping it. Grrrrrrrrrr...

Sep 5 '07 #6
You can download this sample code:
http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!138.entry

and see if it could be the authentication mechanism.

None
Basic
SSL

There is downloadable code, just to make the check quick and clear.


"Homer" <Ho*******@gmai l.comwrote in message
news:11******** *************@r 29g2000hsg.goog legroups.com...
Hi,

I've posted this question before but didn't get anywhere with it.
Please help me out if you know of a solution for it.

I got "InnerException : Unable to connect to remote server"..."No
connection could be made because the target machine actively refused
it" when I attempted to send an email through my Intranet app that is
written in asp.net 2.0. The smtp server is a local server and it uses
Port 25. The Authentication is set to Anonymous Access. I tried
pointing to the SMTP gateway on my Exchange server and I ran into the
same problem. My organization uses Mcafee 8.5i. Does that have to do
with anything? Here's my code:
<system.net>
<mailSettings >
<smtp>
<network host="10.162.22 .72" />
</smtp>
</mailSettings>
</system.net>
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
Const ToAddress As String = "some...@somewh ere.com"
Dim mm As New MailMessage(Use rsEmail.Text, ToAddress)
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False
Dim smtp As New SmtpClient
smtp.Send(mm)
End Sub
In the <network host.. /section, I did not specify a username and
password because I set the smtp server authentication mode is set to
Anonymous Access. Can someone please tell me what I did wrong? I
couldn't find anything on the Web that could point me in the right
direction.
Thanks,
Jon

Sep 6 '07 #7
The problem is almost certainly one of security. SMTP is a network protocol
that uses a specific TCP port (usually 25) to send a message from a client
application to an SMTP server. The SMTP server then sends the message to the
end recipient, usually a POP3 server like Exchange. There are many security
issues involved. First, the SMTP server must be configured correctly to
allow the client to send a message to it. This involves configuring the
Authentication correctly on the SMTP server, and the client using the
correct Authentication method to connect. It also involves configuring Relay
permissions correctly on the SMTP server.

If the SMTP server is not on the same machine as the client, it also
involves the network security between the machines on the network, whether
it is a private network or a public one. The IP address in your MailSetting
section indicates that the SMTP server is on a private network, and I will
assume that the client application is on a machine in the same private
network. Therefore, Firewall software on either the client machine or SMTP
server machine may need to be configured to allow the SMTP traffic.

Assuming that the messages is received by the SMTP server, the SMTP server
can be configured to send the message by any of several means. Inside a
private network, this generally requires that the SMTP server be mapped to a
public IP address using NAT (Network Address Translation), or that it be
configured to use another SMTP server as a "Smart Host." If the SMTP server
has a public IP address, it must be allowed by the network Firewall to pass
the message through. If it uses a Smart Host, the Smart Host must be
configured to allow messages from the client SMTP server, and allowed by the
network Firewall to pass the message through.

I hope you have a network administrator handy to help you figure out what
the problem is.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Homer" <Ho*******@gmai l.comwrote in message
news:11******** *************@r 29g2000hsg.goog legroups.com...
Hi,

I've posted this question before but didn't get anywhere with it.
Please help me out if you know of a solution for it.

I got "InnerException : Unable to connect to remote server"..."No
connection could be made because the target machine actively refused
it" when I attempted to send an email through my Intranet app that is
written in asp.net 2.0. The smtp server is a local server and it uses
Port 25. The Authentication is set to Anonymous Access. I tried
pointing to the SMTP gateway on my Exchange server and I ran into the
same problem. My organization uses Mcafee 8.5i. Does that have to do
with anything? Here's my code:
<system.net>
<mailSettings >
<smtp>
<network host="10.162.22 .72" />
</smtp>
</mailSettings>
</system.net>
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
Const ToAddress As String = "some...@somewh ere.com"
Dim mm As New MailMessage(Use rsEmail.Text, ToAddress)
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False
Dim smtp As New SmtpClient
smtp.Send(mm)
End Sub
In the <network host.. /section, I did not specify a username and
password because I set the smtp server authentication mode is set to
Anonymous Access. Can someone please tell me what I did wrong? I
couldn't find anything on the Web that could point me in the right
direction.
Thanks,
Jon

Sep 6 '07 #8
On Sep 6, 5:40 am, "Kevin Spencer" <unclechut...@n othinks.comwrot e:
The problem is almost certainly one of security. SMTP is a network protocol
that uses a specific TCP port (usually 25) to send a message from a client
application to an SMTP server. The SMTP server then sends the message to the
end recipient, usually a POP3 server like Exchange. There are many security
issues involved. First, the SMTP server must be configured correctly to
allow the client to send a message to it. This involves configuring the
Authentication correctly on the SMTP server, and the client using the
correct Authentication method to connect. It also involves configuring Relay
permissions correctly on the SMTP server.

If the SMTP server is not on the same machine as the client, it also
involves the network security between the machines on the network, whether
it is a private network or a public one. The IP address in your MailSetting
section indicates that the SMTP server is on a private network, and I will
assume that the client application is on a machine in the same private
network. Therefore, Firewall software on either the client machine or SMTP
server machine may need to be configured to allow the SMTP traffic.

Assuming that the messages is received by the SMTP server, the SMTP server
can be configured to send the message by any of several means. Inside a
private network, this generally requires that the SMTP server be mapped to a
public IP address using NAT (Network Address Translation), or that it be
configured to use another SMTP server as a "Smart Host." If the SMTP server
has a public IP address, it must be allowed by the network Firewall to pass
the message through. If it uses a Smart Host, the Smart Host must be
configured to allow messages from the client SMTP server, and allowed by the
network Firewall to pass the message through.

I hope you have a network administrator handy to help you figure out what
the problem is.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:http://www.miradyne.net

"Homer" <HomerS...@gmai l.comwrote in message

news:11******** *************@r 29g2000hsg.goog legroups.com...
Hi,
I've posted this question before but didn't get anywhere with it.
Please help me out if you know of a solution for it.
I got "InnerException : Unable to connect to remote server"..."No
connection could be made because the target machine actively refused
it" when I attempted to send an email through my Intranet app that is
written in asp.net 2.0. The smtp server is a local server and it uses
Port 25. The Authentication is set to Anonymous Access. I tried
pointing to the SMTP gateway on my Exchange server and I ran into the
same problem. My organization uses Mcafee 8.5i. Does that have to do
with anything? Here's my code:
<system.net>
<mailSettings >
<smtp>
<network host="10.162.22 .72" />
</smtp>
</mailSettings>
</system.net>
Protected Sub SendEmail_Click (ByVal sender As Object, ByVal e As
System.EventArg s) Handles SendEmail.Click
Const ToAddress As String = "some...@somewh ere.com"
Dim mm As New MailMessage(Use rsEmail.Text, ToAddress)
mm.Subject = Subject.Text
mm.Body = Body.Text
mm.IsBodyHtml = False
Dim smtp As New SmtpClient
smtp.Send(mm)
End Sub
In the <network host.. /section, I did not specify a username and
password because I set the smtp server authentication mode is set to
Anonymous Access. Can someone please tell me what I did wrong? I
couldn't find anything on the Web that could point me in the right
direction.
Thanks,
Jon- Hide quoted text -

- Show quoted text -
My organization uses Mcafee 8.5i and when I unchecked "block" on "mass
mailing..." I was able to send send messages through. I found a
suggestion from McAfee to add "W3wp.exe" to the exclusion list of port
25 but that turned out to be a dud. I finally unchecked the block and
it worked. I have to check with my ePO guy to see if there is any
security risk in unblocking port 25 altogether.

Thank you everybody for your invaluable help. Please keep the
suggestion coming. The more suggestions I get the more options I have
to explore.

Jon

Sep 6 '07 #9
"Homer" <Ho*******@gmai l.comwrote in message
news:11******** **************@ 22g2000hsm.goog legroups.com...
My organization uses Mcafee 8.5i and when I unchecked "block" on "mass
mailing..." I was able to send send messages through.
Yes indeed.
I found a suggestion from McAfee to add "W3wp.exe" to the exclusion list
of port
25 but that turned out to be a dud.
Curious. I have a client with that exact same issue, and adding w3wp.exe in
"Access Protection Properties" fixed it...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 6 '07 #10

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

Similar topics

2
1390
by: RMG | last post by:
System.Web.Mail.SmtpMail appears to rely upon CDO. Such code therefore works fine on my development box which has Outlook 200 installed. But when the application is deployed to the production server (running W2K Server) the code fails. Do I have to install Outlook or an Exchange client on the production box? Or can CDO be deployed separately? And shouldn't .net indicate this depandancy during complilation of the deployment project? Many...
1
1482
by: Sean | last post by:
Hi all, I have two databases set up, one for development and one for production. They are almost identical. I noticed that a query was taking about 6.7 seconds to execute on the development database, but only .08 seconds on the production database. The only difference was there was another key for the production server (I am guessing it was an index). So I clicked on the "Index" link in PhpPGAdmin for the id of the table on the...
2
357
by: Marc | last post by:
Here is a new error I am getting. I have a development computer (Server 2000, SQL2000, .NET 1.1) I have a production computer (Server 2003, SQL2000, .NET 1.1) When I run my solution on the development box pointing to the database on the development box - no problem. When I run my solution on the production box pointing to the database on the production box - no problem. When I run my solution on the production box pointing to the...
3
491
by: Marc | last post by:
Here is a new error I am getting. I have a development computer (Server 2000, SQL2000, .NET 1.1) I have a production computer (Server 2003, SQL2000, .NET 1.1) When I run my solution on the development box pointing to the database on the development box - no problem. When I run my solution on the production box pointing to the database on the production box - no problem. When I run my solution on the production box pointing to the...
3
12990
by: Imran Aziz | last post by:
Hello All, I am getting the following error on our production server, and I dont get the same error on the development box. Unable to cast object of type 'System.Byte' to type 'System.String'. here is the code that I used to create a table and then add columns to it later, later I populate the rows in the table.
5
2879
by: rogsonl | last post by:
My computer was moved last week, and the company changed the network groups we work on. As a result, one of the main benefits from Whidbey (database connectivity) no longer works. Situation: 1. I open a new project based on a windows form 2. I click on "data" and then "Add New Data Source" then I click on next within the wizard 3. I have 3 choices Database, Local Database, Web service and Object. 4. I choose Database, click next and get...
2
10788
by: Rossco | last post by:
I have a VB.NET serviced component (COM+), running on a lan, that calls out to an external web service to place an order with a supplier. The problem machine is the middle tier (COM+) for our in house applications, and also has a mail server to service a 100 stores (don't ask me why, I don't like this either). The call to the webservice works correctly on our test COM+ machine but fails on the production machine with the above error. ...
2
151650
by: antonyliu2002 | last post by:
I am testing AJAX. I've downloaded the AJAX Extension and the CTP December package and installed on BOTH my development machine and the production server. Then I created a very very simple web application, which contains a button and a label. When the button is clicked, some message is shown on the label. That's it. The AJAX works great on my development machine, but on the production server, I got the typical error as follows:
5
38829
by: mivey4 | last post by:
Hi, First off, I am aware that this is a very heavily documented error and I have done my homework for throughly researching probable causes before deciding to post my problem here. At this point, I believe another set of eyes on the issue is merited. I am a MSSQL DBA and somewhat new to ORACLE; but I have read the administrators manual having a basic thorough level of knowledge (Tho' I am still learning) and understanding of how to...
0
8613
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
9032
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
8908
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
8880
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
7745
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...
1
6532
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
5869
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
4374
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...
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.