Re: Problems with Email, cusmapi
- From: Jan Bucek <bucek.jan@xxxxxxx>
- Date: Wed, 21 Mar 2007 23:52:07 +0100
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
- Follow-Ups:
- Re: Problems with Email, cusmapi
- From: Barley Man
- Re: Problems with Email, cusmapi
- References:
- Problems with Email, cusmapi
- From: Barley Man
- Problems with Email, cusmapi
- Prev by Date: Problems with Email, cusmapi
- Next by Date: Re: Problems with Email, cusmapi
- Previous by thread: Problems with Email, cusmapi
- Next by thread: Re: Problems with Email, cusmapi
- Index(es):
Relevant Pages
|