Re: Problems with Email, cusmapi



Thanks Dan

I know this sounds daft but how do (did) I install mapi controls? I thought
they were part of Outlook itself but I'll be delighted if it's as simple as
install a tool.

ian

"Dan Freeman" wrote:

If the mapi controls are not installed for sending mail, you can't run their
GetErrorInfo() method either because they're not installed.

Dan

"Barley Man" <BarleyMan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:B820AD37-844E-4E4B-8EED-53572C6D229F@xxxxxxxxxxxxxxxx
Well......... errrr..... yes and no!

There are two problems. The first is the problem that is causing the Error
routine to be initiated:-

“cErrTxt=cErrTxt+Chr(10)+oMail.GetErrorInfo(nI)”

....... However, I can't proceed in trying to fix this because the above
line of code fails on the machine where the program fails and doesn't get
'called' on the machines where there is no problem so I can't tell if it
WOULD fail on those machines as well.

Thus I can't see what is the initial, triggering fault as the error
reporting system doesn't work. Unless you are saying that the :-

oMail.GetErrorInfo(nI)

...... is part of a problem with the Mapi 'tools' and thus a failure in
those tools prevents triggers the fault AND prevents the system reporting
what has gone wrong.

To be sure, how do I 'install' the mapi tools on the machines which won't
work? I didn't think I'd done any 'installation on 'my' machines to get it
to
work in the first place. Do you think that I MUST have installed it and
have
forgotten? If so, how the hell did I do it?????

Ian

"Jan Bucek" wrote:

If I understand your problem right, your program works O.K. on 4 PCs and
fails on 3 other PCs. In this case your program code is O. K. and your
problem seems to have something to do with installation of MAPI
components.


Barley Man napsal(a):
I have created a routine to mail batches of emails. It works perfectly
on all
4 of my PCs at home but fails on all 3 of a colleagues’ machine. We
both use
Outlook XP (2002) and both use XP SP on our machines.

I got the information on how to use ‘cusmapi’ to email from this
forum and
pasted the suggestion with modifications into my ‘program’.
However, run on
my colleagues’ machine, the program not only fails but fails at the
point
where it tries to tell me HOW it failed. The system is unable to use
the
error message system in this line:-

“cErrTxt=cErrTxt+Chr(10)+oMail.GetErrorInfo(nI)”

…… as it doesn’t recognise the oMail.GetErrorInfo(nI) part pof
the
instruction.

I can’t see what’s missing: should the oMail.GetErrorInfo() be
somewhere
accessible in the code or is it inherent in the call to cusmapi? Is
there a
misprint in the spelling of o.Mail.GetErrorInfo()?

Without being able to see the content of the ‘help’ message, I
can’t ‘debug’
what causes the failure in the first place. As my development PC
doesn’t
“fail”, I can’t use the debugger which is on that machine to see
the problem!

Any suggestions?

Here is the section in which the component ‘fails’ to run:

******************************************************************

* CREATE list of email recipients
***********************************
* First create compulsory main recipient, won't work without at least
ONE
"To;"

m.cRecipients=Alltrim(parafile.defemail)+";"

* Compulsory Main recipient created

Select allblock
Go Top
Scan
m.cRecipients=m.cRecipients+"BCC:"+(Alltrim(allblock.alemail))+";"
Endscan

Set Classlib To MAPIMAIL Additive
oMail=Createobject("cusmapi")
nOK=oMail.SendMail("", "", cRecipients, m.subjtext, m.mailtext,
m.cAttachments)
Do Case
Case nOK=0
* ?? Chr(7)
Wait Window Nowait Alltrim(Str(m.emailno))+ " EMails created"
Case nOK > 0
cErrTxt=""
For nI=1 To nOK
cErrTxt=cErrTxt+Chr(10)+oMail.GetErrorInfo(nI)
Endfor
Messagebox([Errors:]+cErrTxt, 64, "# of SendMail errors:
"+Transform(nOK))
Case nOK < 0
Messagebox("MAPI client not available")
Endcase

Select allblock
Delete All
m.blockcount=0
Select client





.



Relevant Pages

  • Re: Problems with Email, cusmapi
    ... VFP ships with MAPI controls, ... Does MAPI get installed during the automatic installation of Outlook? ... line of code fails on the machine where the program fails and ... WOULD fail on those machines as well. ...
    (microsoft.public.fox.helpwanted)
  • Re: Problems with Email, cusmapi
    ... The MAPI controls are activex controls typically installed with other applications that need access to the MAPI-compliant mail system. ... Does MAPI get installed during the automatic installation of Outlook? ... line of code fails on the machine where the program fails and doesn't get ... WOULD fail on those machines as well. ...
    (microsoft.public.fox.helpwanted)
  • Re: Problems with Email, cusmapi
    ... I know this sounds daft but how do I install mapi controls? ... I thought they were part of Outlook itself but I'll be delighted if it's as simple as install a tool. ... line of code fails on the machine where the program fails and doesn't get ... WOULD fail on those machines as well. ...
    (microsoft.public.fox.helpwanted)
  • Re: Problems with Email, cusmapi
    ... If the MAPI controls are not installed, the method SendMail returns negative value. ... The problem of installation of MAPI is out of scope of my knowledge. ... line of code fails on the machine where the program fails and doesn't get ... WOULD fail on those machines as well. ...
    (microsoft.public.fox.helpwanted)
  • Re: Problems with Email, cusmapi
    ... If the mapi controls are not installed for sending mail, ... line of code fails on the machine where the program fails and doesn't get ... WOULD fail on those machines as well. ... I didn't think I'd done any 'installation on 'my' machines to get it ...
    (microsoft.public.fox.helpwanted)