Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VB 6.0 to send email via Outlook 2000 1

Status
Not open for further replies.

logo

Programmer
Aug 22, 2001
56
US
Does anyone know of a good resource which discusses how to use send email via Outlook 2000. I would like to be able to link to my user's Outlook account, fill there address, subject, and message fields--but also allow them to modify the information (if they so choose).

--Thanks
 
There is an Outlook Object model you can make a reference to in your VB project
 
There is extensive information on the MAPI object in the MSDN subscription. If you don't have it, I suggest getting a copy.

Very simple demo here, you have to add the Microsoft MAPI component. You have two controls, a MAPI Session and a MAPI Messages control. The Session control is used for signing onto the account basically. You can enter your username and password into the properties of the control itself at design time. Here is a basic example:

Code:
  MAPISession.SignOn 
   'Use MAPISession to sign onto account

  MAPIMsg.SessionID = MAPISession.SessionID
    'Sets the SessionID of the MAPIMessages object to
    'that of the MAPISession you signed onto
  MAPIMsg.Compose
   'Start composing email
  MAPIMsg.RecipAddress = "user@hotmail.com"
   'TO field
  MAPIMsg.MsgSubject = "Test Email"
   'Subject of the email
  MAPIMsg.MsgNoteText = "Body of the email"
   'Body of the email
  MAPIMsg.Send 'Send the email on down the line
   'Send the message

  MAPISession.SignOff
   'Sign off the account
Hope that helps, get the MSDN subscription and it explains it well.
 
Thanks! What is the MSDN subscription and how do I get it?

This looks like the way that I wrote my code...however, it opens Outlook Express. Can I change this so that it opens Outlook.
 
The MSDN subscription SHOULD be the help files for your Visual Basic software... when you get a sytax error for instance, and you hit the "Help" button, the MSDN installation is what it would look for.


From there you can go to the MSDN library and there you will find EVERY OUNCE of information regarding the matter you probably will need, and then some more.

Somewhere on the site you can order the subscription for the CD's to install on your own machine.

As far as your Outlook/Outlook Express problem, I'm not sure. I would have thought MAPI would use whatever mail program was on the machine, I was not aware MAPI was specific to OE... who knows. That demo was for sending an email without opening the email application, even though you will get the little status bar window...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top