Results 1 to 2 of 2

Thread: Email's via sendkeys?

  1. #1
    bennett4455 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.0
    Join Date
    Mar 2010
    Posts
    2
    Reputation
    0

    Thumbs up Email's via sendkeys?

    Do I have to have a 3rd party addin to send email via windows form as I cant stand outlooks security window or is there a way to use sendkeys?? I dont wanna buy 3rd party addins but at the moment it looks like i wont have a choice my attempt at sending email (BELOW) may I add I cant figure out sendkeys and help apreciated.
    and also It has to run through outlook 2003
    I have been looking about for days and this is my last point of call

    Public Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim instance As SendKeys
    Dim obbjol As Object, obbjmail As Object


    obbjol = CreateObject("Outlook.Application")
    obbjmail = obbjol.CreateItem(0)


    With obbjmail
    .Subject = "Text"
    .To = "aa@.com"
    .Body = "Text" & vbCrLf & vbCrLf & _
    "Thank you"
    .Display()

    End With
    ' email is now visable
    instance.sendkeys.send("%S")


    Exit Sub

  2. #2
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,086
    Reputation
    2803
    How to format posts with code blocks etc - present the problem/post properly

    Visual Studio Community 2017

Bookmarks

Posting Permissions

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