Solved

Done a Million Times

Posted on 2000-03-24
2
292 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 143

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 3 hours left to enroll

627 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