Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2003, 09:23 PM
Authorized User
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to alantodd
Default MAPI not working with MS Outlook

Hi Everyone,

I am building an application in VB 6.0 that needs to be able to send e'mails. I have included the MAPI controls MAPIMessage & MAPISession and all is working well on workstations that are using MS Outlook Express as their e'mail client. However, on the workstations that are using MS Outlook, everytime you send your message, the system generates an error message that reads 'Unspecified Failure has occured'

Not much help unfortunately.

Has anyone else seen this?

Any suggestions?

Thanks,

Alan Todd

P.S. Here is the code:

    MAPISess.SignOn
    MAPIMess.SessionID = MAPISess.SessionID
    MAPIMess.Compose
    MAPIMess.RecipAddress = To.Text
    MAPIMess.AddressResolveUI = True
    MAPIMess.MsgSubject = Subject.Text
    MAPIMess.MsgNoteText = Body.Text
    MAPIMess.Send
    MAPISess.SignOff
 
Old June 17th, 2003, 04:20 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to atingoldy Send a message via MSN to atingoldy Send a message via Yahoo to atingoldy
Default

May be this can solve ur problem
http://www.ilook.fsnet.co.uk/vb/vbmapi.htm

Atin
 
Old June 17th, 2003, 04:24 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to atingoldy Send a message via MSN to atingoldy Send a message via Yahoo to atingoldy
Default

'or use this code
Public Function send_mail(sendto As String, subject As String, _
  text As String) As Boolean
'Add The MAPI Components and
'add a MAPI Session and MAPI mail control to your form

On Error GoTo ErrHandler
    With MAPISession1
            .DownLoadMail = False
            .LogonUI = True
            .SignOn
            .NewSession = True
            MAPIMessages1.SessionID = .SessionID
    End With
    With MAPIMessages1
        .Compose
        .RecipAddress = sendto
        .AddressResolveUI = True
        .ResolveName
        .MsgSubject = subject
        .MsgNoteText = text
        .Send False
    End With
sendmail = True
ErrHandler:
  End Function

May be u r satisfied now.:D
OK Take care :)

Atin
 
Old June 26th, 2006, 10:55 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok for the example, work fine but I need to know how to send a message in an HTML format.

Do you know how?

Send me response by email please.....

thk
steeve
[email protected]






Similar Threads
Thread Thread Starter Forum Replies Last Post
talking to ms outlook from app wildt ASP.NET 1.x and 2.0 Application Design 0 March 24th, 2005 01:05 PM
Outlook 97/2003 Mapi code chuckdaniels Access VBA 2 March 6th, 2005 04:09 PM
send/receive in MS Outlook dotnetprogrammer VS.NET 2002/2003 0 February 25th, 2005 12:01 AM
Write a macro for MS-Outlook sachin-csharp .NET Framework 2.0 0 August 28th, 2004 02:29 AM
MAPI and outlook Yuelie VB Components 0 July 20th, 2003 11:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.