Re: Problems with Email, cusmapi



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


GetErrorInfo() is method of CUSMAPI. If the MAPI controls are not installed (not found), the method SendMail returns negative value (I am sure, I have seen it).


The problem of (correct) installation of MAPI is out of scope of my knowledge. I remember discussion about this, but whether this or other forums...


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
    ... 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)
  • Re: Problems with Email, cusmapi
    ... 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 have now tested more machines and anything installed from 'new' and running ... Microsoft MAPI Sessions Control, v6. ... Does MAPI get installed during the automatic installation of Outlook? ... line of code fails on the machine where the program fails and ...
    (microsoft.public.fox.helpwanted)