Results 1 to 6 of 6

Thread: Sending a mail message within VB.NET

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Code:
    Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
    mailMessage.From = "[email protected]"
    mailMessage.To = "[email protected]"
    mailMessage.Subject = "Email Subject"
    mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text
    
    System.Web.Mail.SmtpMail.SmtpServer = "localhost"
    System.Web.Mail.SmtpMail.Send(mailMessage)
    wether your app is ASP .NET or not is a moot point.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  2. #2
    Junior Member
    Join Date
    Jun 2002
    Posts
    16

    Re:

    Cander,
    The code you pasted comes up with errors on using the System.Web.Mail library. Since my project is not an ASP.NET project... the developer does not allow the use of this library. Is there a way to work around this?

  3. #3

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Again, it does not matter. If you are having problems, it is because you probably dont have the cdonts object which is an older component that system.web.mail is just a wrapper for.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  4. #4
    Junior Member
    Join Date
    Jun 2002
    Posts
    16

    Re:

    Cander,
    I am new to VB... how do i check if the CDONTS object is available or not installed?

    Sorry to keep bugging ya.

  5. #5
    Junior Member
    Join Date
    Jun 2002
    Posts
    16
    I figured out the prob, i need to add the web.dll to my references under the solution explorer.

  6. #6
    Lively Member
    Join Date
    Apr 2001
    Posts
    93
    but i guess we still need smtp server installed for this code. i am looking for one simple email program that uses outlook express to send emails

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width