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*******@gmail.comwrote in message
news:11*********************@r29g2000hsg.googlegro ups.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.EventArgs) Handles SendEmail.Click
Const ToAddress As String = "some...@somewhere.com"
Dim mm As New MailMessage(UsersEmail.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