How do I send an email using Outlook Express

Posted on 2004-11-06
Medium Priority
Last Modified: 2010-04-23
I am relatively new to VB.NET programming, so the answer to my question may require some detail code.
I want to send an email to many recipients whose addresses are in a list box.
I wish to supply the subject and body of the email from text fields.
If I need to import files I need to know which ones.
I am using the first release of Visual Studio.Net Enterprise Edition.
I have searched this data base with poor results.
Question by:Harold_Lominac
LVL 28

Accepted Solution

iboutchkine earned 1000 total points
ID: 12513367
   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.send_via_0("test subject", "iboutchkine@bla.com", "Hi Iouri", "Outlook")
    End Sub
 Private Sub send_via_0(ByVal subject As String, ByVal toe As String, ByVal body As String, ByVal from As String)
        Dim Appl As Object
        Dim out As Object
            Appl = CreateObject("Outlook.Application")
            out = Appl.CreateItem(0)
            With out
                .Subject = subject
                .To = toe
                .Body = body
                'to use html in the email instead of plain text
                'use .HTMLBody instead of .body
            End With
        Catch ex As Exception
            MsgBox("Error " & Err.Number & ": " & ex.Message, MsgBoxStyle.Critical, "Error")
        End Try
    End Sub


Author Comment

ID: 12514278
Thanks for your quick reply.  It seems straight forward, but I haven't tried it yet.  
You show "from" as "Outlook"  Would it be "Outlook Express" for Outlook Express?
Also I learned my client uses AOL.  How would I write code for that, set from to AOL?

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question