using MAPI to email from VB
Posted on 2002-05-16
I have a form showing contact data for clients and an email button to open the default MAPI client ready to fill in a message to the address shown on the form. The code behind the button is
Private Sub cmdemail_Click()
cmdemail.Enabled = False
MAPISess.Action = 1
MapiMess.SessionID = MAPISess.SessionID
MapiMess.RecipAddress = email.Text
On a machine using Outlook Express as the email client everything works well clicking on the button opens Outlook Express with the recipients address filled in ans the email can be sent.
When the program is run on a PC running Outlook 2000
The code halts at 'MapiMess.Send (True)'
and I get the error message 'runtime error 32002 Unspecified failure has occured'
Anybody seen this before and know of a work around.
I need the function to work in both Outlook and outlook express.
I get the Message