I want MS Outlook to open with the email address line automatically entered. That part seems to work,
The problem is when I click "Send", the Outlook window closes, (that's ok). But the email doesn't seem to be sent. I've been using one of my own email addresses for testing and nothing has shown up.
I must be missing something but don't know what.
Any information would be appreciated.
EDIT - I opened Outlook, and then the emails were sent, I also test the code with Outlook already open and it worked. Maybe I had to do this because Outlook is not my default email account, I use Att/Yahoo. Is there a way to force the email to be sent without having Outlook open?
Code:
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
Dim app As Outlook.Application = New Outlook.Application()
Dim itm As New System.Object
Dim olItm As Outlook.MailItem
olItm = app.CreateItem(Outlook.OlItemType.olMailItem)
olItm.To = "someAddress@sbcglobal.net"
olItm.Display(True)
olItm = Nothing
app = Nothing
'itm = app.CreateItem(0)
'itm.To = "someAddress@sbcglobal.net"
'itm.display()
End Sub
I must be missing something but don't know what.
Any information would be appreciated.
EDIT - I opened Outlook, and then the emails were sent, I also test the code with Outlook already open and it worked. Maybe I had to do this because Outlook is not my default email account, I use Att/Yahoo. Is there a way to force the email to be sent without having Outlook open?