unable to connect to the remote server while sending email

unable to connect to the remote server while sending email

am 18.10.2007 14:36:01 von sridhar

Hi,

I have created a windows application to send the emails. Following is the
code I am using.

Dim errMsg As String
Dim ToAddress As String
Dim FromAddress As String
Try
ToAddress = "tome@mycompany.com"
FromAddress = "fromsomeone@mycompany.com"
Dim mm As New MailMessage(FromAddress, ToAddress)

mm.Subject = "Test"
mm.Body = "Test Email"
mm.IsBodyHtml = False

Dim smtp As New SmtpClient
smtp.Send(mm)

Catch ex As Exception
errMsg = ex.InnerException.Message
End Try

In the app.config I specified








I am running this code on windows vista. I am not sure if that is the issue.
If so how could I resolve that?

Thanks,

Re: unable to connect to the remote server while sending email

am 18.10.2007 17:41:37 von RAD

On Thu, 18 Oct 2007 05:36:01 -0700, Sridhar
wrote:

>Hi,
>
> I have created a windows application to send the emails. Following is the
>code I am using.
>
>Dim errMsg As String
> Dim ToAddress As String
> Dim FromAddress As String
> Try
> ToAddress = "tome@mycompany.com"
> FromAddress = "fromsomeone@mycompany.com"
> Dim mm As New MailMessage(FromAddress, ToAddress)
>
> mm.Subject = "Test"
> mm.Body = "Test Email"
> mm.IsBodyHtml = False
>
> Dim smtp As New SmtpClient
> smtp.Send(mm)
>
> Catch ex As Exception
> errMsg = ex.InnerException.Message
> End Try
>
>In the app.config I specified
>
>
>
>
>

>

>

>
>I am running this code on windows vista. I am not sure if that is the issue.
>If so how could I resolve that?
>
>Thanks,

What is the problem? You'd get more (and better) assistance if you
specify what your problem is.

--
http://bytes.thinkersroom.com

Re: unable to connect to the remote server while sending email

am 18.10.2007 18:08:02 von sridhar

I put the error message in the subject. This is the detailed error message

System.Net.Mail.SmtpException - Failure sending mail.
InnerException - Unable to connect to Remote server.
No Connection could be made because the target machine actively
refused it.

Thanks,

"Rad [Visual C# MVP]" wrote:

> On Thu, 18 Oct 2007 05:36:01 -0700, Sridhar
> wrote:
>
> >Hi,
> >
> > I have created a windows application to send the emails. Following is the
> >code I am using.
> >
> >Dim errMsg As String
> > Dim ToAddress As String
> > Dim FromAddress As String
> > Try
> > ToAddress = "tome@mycompany.com"
> > FromAddress = "fromsomeone@mycompany.com"
> > Dim mm As New MailMessage(FromAddress, ToAddress)
> >
> > mm.Subject = "Test"
> > mm.Body = "Test Email"
> > mm.IsBodyHtml = False
> >
> > Dim smtp As New SmtpClient
> > smtp.Send(mm)
> >
> > Catch ex As Exception
> > errMsg = ex.InnerException.Message
> > End Try
> >
> >In the app.config I specified
> >
> >
> >
> >
> >

> >

> >

> >
> >I am running this code on windows vista. I am not sure if that is the issue.
> >If so how could I resolve that?
> >
> >Thanks,
>
> What is the problem? You'd get more (and better) assistance if you
> specify what your problem is.
>
> --
> http://bytes.thinkersroom.com
>

Re: unable to connect to the remote server while sending email

am 19.10.2007 12:11:03 von RAD

On Thu, 18 Oct 2007 09:08:02 -0700, Sridhar
wrote:

>I put the error message in the subject. This is the detailed error message
>
>System.Net.Mail.SmtpException - Failure sending mail.
>InnerException - Unable to connect to Remote server.
> No Connection could be made because the target machine actively
>refused it.
>

Ah, I missed that.

With regards to your smtp server, perhaps it requires authentication?

--
http://bytes.thinkersroom.com