Article View: borland.public.cppbuilder.nativeapi
Article #13652Re: Send a mail with attachment
From: Remy Lebeau (TeamB)
Date: Thu, 02 Oct 2003 16:28
Date: Thu, 02 Oct 2003 16:28
19 lines
2019 bytes
2019 bytes
"David Ayre" <davidcayre@aol.com> wrote in message
news:3f7beff9$1@newsgroups.borland.com...
> I have managed to build the .lib file for the mapi32.dll and the
> programme compliles. I now have the problem that it returns an
> error code saying that logon failed.
You did not call MapiLogon() before calling MapiSendMail(). You applied
MAPI_LOGON_UI and MAPI_NEW_SESSION to the message sturcture, but those are
not message flags to begin with. They needed to be passed to the
MapiSendMail() function instead, not the MAPIMESSAGE structure:
lpMessage.flFlags = 0;
ULONG ulResult = MAPISendMail(0, 0, &lpMessage, MAPI_LOGON_UI |
MAPI_NEW_SESSION, 0);
Gambit
Technical Details
Message-ID:
<3f7c5204@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!proxad.net!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f70794d@newsgroups.borland.com> <3f784a32@newsgroups.borland.com> <3f79708b@newsgroups.borland.com> <3f79860c@newsgroups.borland.com> <3f799567@newsgroups.borland.com> <3f79bd46$1@newsgroups.borland.com> <3f79c517@newsgroups.borland.com> <3f79d851@newsgroups.borland.com> <3f7a8b6d$1@newsgroups.borland.com> <3f7beff9$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,23d9e1242f297072 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-10-02 10:25:30 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f70794d@newsgroups.borland.com> <3f784a32@newsgroups.borland.com> <3f79708b@newsgroups.borland.com> <3f79860c@newsgroups.borland.com> <3f799567@newsgroups.borland.com> <3f79bd46$1@newsgroups.borland.com> <3f79c517@newsgroups.borland.com> <3f79d851@newsgroups.borland.com> <3f7a8b6d$1@newsgroups.borland.com> <3f7beff9$1@newsgroups.borland.com> Subject: Re: Send a mail with attachment Date: Thu, 2 Oct 2003 09:28:37 -0700 Lines: 21 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.22.137.75 Message-ID: <3f7c5204@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1065112068 67.22.137.75 (2 Oct 2003 09:27:48 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!proxad.net!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail