Solved

Done a Million Times

Posted on 2000-03-24
2
282 Views
Last Modified: 2010-05-02
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.
0
Comment
Question by:hello_200
2 Comments
 

Accepted Solution

by:
sljbaqga earned 29 total points
ID: 2656200
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
regards
Prasad
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2656328
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"
send"
  x.Send
  a.Quit
  Set x = Nothing
  Set a = Nothing

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now