Link to home
Start Free TrialLog in
Avatar of bman9111
bman9111

asked on

sending email in vb.net

I am using

Imports System.Web.Mail


but when a user with 98 tries to run my program it gives an error stating:

This operation requires Windows NT, Windows 2000, or Windows XP.


Is there a fix for this problem. Meaning something I need to download on a 98 pc or does this mean I have to go back to the old outlook com way


Avatar of j_gardiner
j_gardiner

Are you specifing a mail server or loacalhost?

   SmtpMail.SmtpServer="localhost"

If they don't have a mail server running it won't run. You may be able to specify remote mail server.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bman9111

ASKER

this is my code


Dim Mail As MailMessage
        Try
            Mail = New MailMessage
            Mail .BodyFormat = MailFormat.Text
            Mail .From = "from@aol.com
            Mail .To = "user@aol.com"
            Mail .Subject = "Email"
            Mail .Body = "Hello"
            SmtpMail.SmtpServer = "192.168.0.102"
            SmtpMail.Send(Mail )
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
        End Try
It will not work on Win98!
From the .Net help file

Requirements
Namespace: System.Web.Mail

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web (in System.Web.dll)
ok that is what I thought, just wanted to check to see If I might have done something wrong. I guess I will have to go back to the outlook com way. Thanks


give a try to FreeSMTP. You will have other problems with Outlook ( a confirmation message box will need to be acknowledge everytime you will send an e-mail).