Re: Problems with Email, cusmapi



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: PCs network maintenance
    ... Let's say I have a domain and a naumber of PCs ... WMI fails the same way. ... How to access a computer registry or get above information if it is on the network? ...
    (microsoft.public.win32.programmer.networks)
  • Re: Active Sync 4.1 & Windows Mobile 5.0
    ... one PC with the latest AS and fails a hundred different ways on some other ... Installed AS 4.2beta, rebooted, plugged the cradle into USB port, put my ... I tried switching off while in the cradle, switching on, off, on, taking ... So it seems there is some bug with AS and those PCs. ...
    (microsoft.public.pocketpc.activesync)
  • sp2 install - cannot copy apph_sp.sdb / filename, directory name o
    ... I have 3 pcs and a laptop at home and sp2 worked first time on all but one pc ... where it fails on file apph_sp.sdb with install saying it cannot copy file. ...
    (microsoft.public.windowsupdate)
  • Re: Gnome Pilot/Evolution crash
    ... After updating evolution with yum as ... nothing fails so far on two pcs. ... Dang. ... but gpilod still fails almost as soon as I ...
    (Fedora)
  • Re: Arguments not passed in Windows XP
    ... print "numargs $numargs\n"; ... This script works fine on a number of our PCs but fails on two ...
    (comp.lang.perl.misc)