Link to home
Start Free TrialLog in
Avatar of kannanonline
kannanonline

asked on

Opening Oulook Express From Visual Basic

How do i open up an Outlook express from VB to send a Mail?
Avatar of roverm
roverm
Flag of Netherlands image

This should do the trick:

Private Sub Command1_Click()
Dim objOutlook As Object
Dim objMail As Object

    Set objOutlook = CreateObject("Outlook.Application")
    Set objMail = objOutlook.CreateItem(0)
       
    With objMail
        .To = "bill.gates@microsoft.com"
        .Subject = "MyTestMail"
        .Body = "This is the text."
        .Send
    End With
   
    Set objMail = Nothing
    Set objOutlook = Nothing
   
End Sub

D'Mzzl!
RoverM
ASKER CERTIFIED SOLUTION
Avatar of PaulHews
PaulHews
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DanRollins
Hi kannanonline,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept PaulHews's comment(s) as an answer.

kannanonline, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
Comment from expert accepted as answer

Computer101
E-E Moderator