Re: From my VB 2005 express Form. Want to send EMail

Tech-Archive recommends: Speed Up your PC by fixing your registry



The imports have to be above the Public Class statement.
Does that help?

Robin S.
---------------------
"Professor Yonce" <ProfessorYonce@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:AFF7C33F-42D4-4682-90E4-271315B8E27C@xxxxxxxxxxxxxxxx
I have made form for E-Mail. I have entered code but the Import system does
not work. It has squiggly line underneath it showing it is not
communicating.
It Will not build.

Public Class Form3Bio1
System.Net.Mail.SmtpClient
Imports System.Net.Mail ' This line before ' does not work.
I have the rest of code to try if and when I am able to get System
working.

' I XXX out certain entrys below just for this publication.

Dim emailSender As SmtpClient
Dim theMessage As MailMessage
Dim SHost As String = ("smtp.XXXXX.com")
Dim Passwd As String = ("Harold45")
Dim Recv As String = ("Inssur@xxxxxxxxxx")
Dim Sndr As String = ("Harold@xxxxxx")
Dim Body As String = (Form4Bio1.TextBox5.Text) +
(Form4Bio1.ListBox1.Items)
emailSender = New System.Net.Mail.SmtpClient( _
SHost)

theMessage = New MailMessage
theMessage.From = New MailAddress(Sndr)
theMessage.To.Add(Recv)
theMessage.Subject = (Form4Bio1.TextBox4.Text)
theMessage.password = (Passwd)
theMessage.Body = (Form4Bio1.TextBox5.Text) +
(Form4Bio1.ListBox1.Items)

I have tried Importing the System.Net.Mail but can't find it. I have .Net
2.0 installed.
My form system just does not allow System nor recognize the System.Net
Thanks for your kind help in advance. I do not know how I can get my code
to
recognize Imports.System.Net.Mail.
--
Professor Yonce, Retired commercial pilot. Also retired college department
Director and Professor. Presently a Communications Consultant and
Developer.
Was this post helpful to you?


--
Professor Yonce, Retired commercial pilot. Also retired college department
Director and Professor. Presently a Communications Consultant and
Developer.


.



Relevant Pages

  • Re: Importing text, etc. on remote .mdb file
    ... You can then use VBA string functions to get from there to the ... Is there an easy way to schedule the imports of the text files so I ... 'Modify strSQL and filenames as required ... Dim oJet 'DAO.DBEngine ...
    (microsoft.public.access.externaldata)
  • RE: Logon Error
    ... > Imports CrystalDecisions.CrystalReports ... > function is emailPDFwhich calls ChangeLogOnInfo EmailPDF returns a Report ... > Dim szErrorMailSecondary As String 'This is where all the mail messages ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: MapiSendMail and web browser
    ... Public Shared Function SendMail(ByVal strAttachmentFileName As String, ... Dim winhandle As IntPtr = New IntPtr ... Public Class MapiMessage ...
    (microsoft.public.win32.programmer.messaging)
  • Re: Eval code and AppDomains
    ... Do you know of any other way to Eval a String to get a Boolean result other ... >> Dim objEval As New EvalProvider ... >> Imports Microsoft.VisualBasic ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to OPEN native PRINTER DIALOG -- Please HELP !!
    ... > function IsNetworkPrinter(PrinterName as string) as boolean ... Public Class YourPrintDialog ... Dim infos As New ArrayList ... ByRef cchBuffer As Int32) As Int32 ...
    (microsoft.public.dotnet.languages.vb)