• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 301
  • Last Modified:

Done a Million Times

I am trying to send an email from a VB form, I have tried to do it a million times but most of the code that i have found is very complicated. I need something that is simple and easy to understand. The only fields that am using are TO,Subject and message.I prefer using either outlook objects or CDO whichever works.
1 Solution
you can use MAPI Controls comming with VB6
add component MAPI Contols.
then use MAPI Session and MAPI Message controls to send what ever the messages you wants to send.

there is a good sample project comes with MSDN.
its located in <MSDN Path>\98VS\1033\SAMPLES\VB98\misc\Vbmail folder

ex. in my machine it's
C:\Program Files\Microsoft Visual Studio\MSDN98\98VS\1033\SAMPLES\VB98\misc\Vbmail

have a look
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Add Microsoft Outlook to your references:

  Dim x As Outlook.MailItem
  Dim a As Outlook.Application
  Set a = New Outlook.Application 'using an open session or loggin on using the default profile
  Set x = a.CreateItem(olMailItem)
  x.To = "Hengel@tecsys.lu"
  x.Subject = "Mail using outlook"
  x.Body = "This is the text to send"
  Set x = Nothing
  Set a = Nothing

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now