Question Problem with System.Web.Mail.MailMessage

SpringfieldD

New member
Joined
Oct 12, 2010
Messages
4
Programming Experience
3-5
I use Visual Studio 2003, VB.net, NetFramework 1.4 and Windows XP

I have been using the following Code Snippet for a number of years in both Web Services and Windows Applications.
However suddenly around the 29th September 2010 it has stopped sending E-Mails from both Web Services and Windows Applications.
The same problem has happened not only to my own Network but on two other Networks, one using XP as its Server and the other using Server 2003.
All 3 of these are using different ISPs.

Snippet**********
Imports System.Web.Mail
'
'
Dim Message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
Try
Message.Body = "Whatever ..."
Message.To = "My E-Mail Address"
Message.From = "Sender's E-Mail Address"
Message.Subject = "Something ..."
SmtpMail.SmtpServer.Insert(0, "127.0.0.1 or your mail server name here")
SmtpMail.Send(Message)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Snippet ***********
'
Nothing clever and it has ALWAYS worked in the past.
Now it just doesn't send anything and doesn't generate any Exception Message.

It's not (?) Machine Setup, Program change, ISP problem, Anti-Virus Program, User, etc and I am totally at a loss to explain what has happened!

There is one possible exception/reason, all the systems affected have one thing in common - Windows Update!

Has anyone else had these problems and/or has anyone any comment or suggestions?

David Smith.
 
I have removed SMTP from IIS using Add/Remove Programs and then re-installed it.
This didn't help.
I have tried Telnet SMTP and this checks out OK for my Machine.
Also tried SLCheck.exe which also checked out OK.
From the above it would seem that my Machine's SMTP Server isn't a problem!

Would someone else please make a Windows Application with the Code Snippet and see how it goes.

David Smith
 
Try this code. If it doesn't work you should (as i mentioned) re-apply the SMTP SETTINGS, and not reinstall it

VB.NET:
Dim Message As New MailMessage
        Try
            Message.Body = "Whatever ..."
            Message.To.Add(New MailAddress("kulrom@server.com"))
            Message.From = New MailAddress("kulrom@server.com")
            Message.Subject = "Something ..."
            Dim smtp As New SmtpClient("localhost")
            smtp.Send(Message)
            Message.Dispose()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
 
Unfortunately System.Net.Mail isn't in NetFramework 1.4 so I can't try your Code!
I'm new to this and would appreciate it if you could explain how to Re-Apply SMTP Setting in IIS (IIS 5.1)

I have tried testing my ISP's MailServer with the following result:
smtp:eek:utmail.MyName.f2s.com smtp
220 smtp.f2s.tiscali.co.uk ESMTP

Not an open relay.
0 seconds - Good on Connection time
0.764 seconds - Good on Transaction time
OK - 212.74.114.25 resolves to smtp.f2s.tiscali.co.uk
OK - Reverse DNS matches SMTP Banner

'Not an Open Relay' looks a bit suspicious but nevertheless my normal Outlook E-Mail is working OK.
Apologies if I am a bit of a pest but I just cannot see why something that has worked for years just stops working.
It doesn't seem to be my Machine and/or ISP because it has also stopped for 2 other Machines with different ISP's and as I said the only common factor might be Windows Updates.
Don't lose patience with me.

David Smith
 
Back
Top