Results 1 to 2 of 2

Thread: Any VB Gurus out there?

  1. #1

    Thread Starter
    Lively Member quadoc's Avatar
    Join Date
    Jan 1999
    Location
    Ga, USA
    Posts
    83

    Angry

    In word you can send mail to other users, How do I use
    this email capability in VB? Please shed some light.

    Thanks,

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Lightbulb

    You can use Outlook Object Library. So, first, add a reference to Microsoft Outlook 98 Type Library (or select the version yo have installed). Then use this code:
    Code:
    Private Sub Command1_Click()
        Dim objOutlook As New Outlook.Application
        Dim objMailItem As New Outlook.MailItem
        
        Set objMailItem = objOutlook.CreateItem(olMailItem)
        With objMailItem
            .To = "[email protected]"
            .Subject = "This is a test email"
            .Body = "It is amazing what you can do with Outlook object library."
            .Send
        End With
    End Sub

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