Home All Groups Group Topic Archive Search About
Author
1 May 2010 8:53 PM
Joe
I am attempting to send an SMTP mail from my VB.NET program
using the code below.   The code compiles and runs fine executes with
no errors, but I am sending to one of my alternate addresses and the e-
mail is not arriving.

      I was thinking that if there was something fundamentally wrong
with my host servername or credentials, that the SMTPClient class
would throw an SMTPException, but it does not.  According to Microsoft
Outlook, my outgoing server does not require authentication, and
sending e-mails from there works fine for me.

      Can anyone tell me what I am doing wrong in my code below?

Private Sub SendEMailResponse(ByVal sReplyToAddress As String, ByVal
sResponseText As String)
        Dim smtpCrawler As New SmtpClient
        Dim ResponseEMail As New MailMessage
        Dim FromAddress As New MailAddress("MyAddr***@service.com",
"My Display Name")
        Dim ToAddress As New MailAddress(sReplyToAddress)

        smtpCrawler.Host = "smtp.west.cox.net"
        smtpCrawler.Port = 25

        With ResponseEMail
            .From = FromAddress
            .To.Add(ToAddress)
            .Subject = "This is a test"
            .Body = sResponseText
        End With

        Try
            smtpCrawler.UseDefaultCredentials = False
            smtpCrawler.Credentials = New
NetworkCredential("MyUsername", "MyPassword")
            smtpCrawler.Send(ResponseEMail)
            MsgBox("E-mail response successfully sent.")
        Catch ex As SmtpException
            MsgBox(ex.Message, MsgBoxStyle.Critical)
        End Try

    End Sub

Author
1 May 2010 9:42 PM
Michel Posseth [MCP]
Is your server an exchange server ?

In the case that the answer is yes , make sure that SMTP is actually
availlable on the local domain

test this like this

Open an command prompt, and enter this command:

C:\WINDOWS>telnet smtp.west.cox.net 25

after a short time the answer will be

220  this string will vary but is mostlly a versioning string and something
like "SMTP Mail Server Ready"

If you do not see the above but an error or timeout or whatsoever , well
then contact your system administrator cause he needs to setup
a virtuall smtp in the local network from the exchange server .

If the server does respond , then make sure you are not breaking anny of the
exchange paranoia rules for instance  like trying to send an e-mail where
the senders domain name is non existent in the exchange domain list   (
there will be no error the mail is just not send , hey that sounds familiar
:-)  )

if it was authentication then you should have got an error , but before i go
anny further you might test the above first

HTH

Michel Posseth




Show quoteHide quote
"Joe" <delphi***@cox.net> schreef in bericht
news:9b2c5b92-9a2f-40a4-9de3-a19db704898f@42g2000prb.googlegroups.com...
>      I am attempting to send an SMTP mail from my VB.NET program
> using the code below.   The code compiles and runs fine executes with
> no errors, but I am sending to one of my alternate addresses and the e-
> mail is not arriving.
>
>      I was thinking that if there was something fundamentally wrong
> with my host servername or credentials, that the SMTPClient class
> would throw an SMTPException, but it does not.  According to Microsoft
> Outlook, my outgoing server does not require authentication, and
> sending e-mails from there works fine for me.
>
>      Can anyone tell me what I am doing wrong in my code below?
>
> Private Sub SendEMailResponse(ByVal sReplyToAddress As String, ByVal
> sResponseText As String)
>        Dim smtpCrawler As New SmtpClient
>        Dim ResponseEMail As New MailMessage
>        Dim FromAddress As New MailAddress("MyAddr***@service.com",
> "My Display Name")
>        Dim ToAddress As New MailAddress(sReplyToAddress)
>
>        smtpCrawler.Host = "smtp.west.cox.net"
>        smtpCrawler.Port = 25
>
>        With ResponseEMail
>            .From = FromAddress
>            .To.Add(ToAddress)
>            .Subject = "This is a test"
>            .Body = sResponseText
>        End With
>
>        Try
>            smtpCrawler.UseDefaultCredentials = False
>            smtpCrawler.Credentials = New
> NetworkCredential("MyUsername", "MyPassword")
>            smtpCrawler.Send(ResponseEMail)
>            MsgBox("E-mail response successfully sent.")
>        Catch ex As SmtpException
>            MsgBox(ex.Message, MsgBoxStyle.Critical)
>        End Try
>
>    End Sub
Author
1 May 2010 10:04 PM
Mayayana
> According to Microsoft
> Outlook, my outgoing server does not require authentication

According to this is does require authentication:

http://support.cox.com/sdccommon/asp/contentredirect.asp?sprt_cid=a401da4a-6e7d-423e-95f6-aa0f2943c01f

  In that case it's also not port 25. Typically it's
port 587 but the page linked above seems to
indicate it's port 465. If you thought it didn't
need authentication then why are you sending
your password?
Author
2 May 2010 11:52 PM
Joe
On May 1, 3:04 pm, "Mayayana" <mayay...@invalid.nospam> wrote:
> > According to Microsoft
> > Outlook, my outgoing server does not require authentication
>
> According to this is does require authentication:
>
> http://support.cox.com/sdccommon/asp/contentredirect.asp?sprt_cid=a40....
>
>   In that case it's also not port 25. Typically it's
> port 587 but the page linked above seems to
> indicate it's port 465. If you thought it didn't
> need authentication then why are you sending
> your password?

Because nothing else that I was trying was working, so I gave it a
username and password as a last resort.   Thank you everyone for your
responses, I will give them all a try.

J
Author
3 May 2010 12:05 AM
Joe
On May 2, 4:52 pm, Joe <delphi***@cox.net> wrote:
Show quoteHide quote
> On May 1, 3:04 pm, "Mayayana" <mayay...@invalid.nospam> wrote:
>
> > > According to Microsoft
> > > Outlook, my outgoing server does not require authentication
>
> > According to this is does require authentication:
>
> >http://support.cox.com/sdccommon/asp/contentredirect.asp?sprt_cid=a40....
>
> >   In that case it's also not port 25. Typically it's
> > port 587 but the page linked above seems to
> > indicate it's port 465. If you thought it didn't
> > need authentication then why are you sending
> > your password?
>
> Because nothing else that I was trying was working, so I gave it a
> username and password as a last resort.   Thank you everyone for your
> responses, I will give them all a try.
>
> J

I did the telnet thing recommended above and I got back this string
"220...cox.net biznetsmtp ESMTP server ready"

so I assume that this means that I am talking to an SMTP server.

J