Highlighted
Absent Member.
Absent Member.
5587 views

[archive] Problems with CobolMail and email.exe

[Migrated content. Thread originally posted on 28 March 2004]

I have downloaded both of these and tried to use them with no success so far. The error I get on both is 15 - bad recipient type. I found on Microsoft's developers web site that the valid codes for a recipient are 1 for To:, 2 for CC:, and 3 for BCC:. I can't see where this is set in these programs though. Am I overlooking something too obvious? I am just using one of my own e-mail addresses, rscheck@edctechnology.com. I see where someone else had this same problem earler, but I could not find the resolution.
This would also be a nice feature if I could allow the person to copy or blind copy other recipients. Has anyone been able to find where on Microsoft's web site it explains this further?
Thanks to anyone who can point me in the right direction!
0 Likes
22 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

There are so many source examples around, it would be much easier to help if you could provide a small test case of yours together with your question.
And, remember, small is beautiful. The smaller the example, the easier to get help.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Sorry, I didn't realize.
That's quite a chore...trying to include enough without including too much? But here is my attempt attached. It appears to work fine except when I get to :

CALL "MAPISendMail" USING
BY VALUE MAPI-SESSION-HANDLE
BY VALUE H-ACU-WND
BY VALUE MAPI-MESSAGE-PTR
BY VALUE PREFERRED-SEND
BY VALUE MAPI-RESERVED-NULL
GIVING MAPI-RESULT
ON EXCEPTION STOP RUN.

MAPI-RESULT is 15.

It appears to me from reading the MSDN web site that it means that the recipient type is not 1, 2, or 3. But I don't see how to set that. And it would be a nice thing to set for CC: and BCC: also.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

It appears when I went to preview reply it didn't keep the attachment? So here is another try WITH the attached program.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Before I look at this, may I ask why you would use the API directly instead of the MSMapi32.ocx wrapper. The latter is significantly easier to work with.
Would you consider that?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

I started working with the API directory because that is the solution I ran across first. I am also working on a program that uses the MSMAPI32.OCX, but that doesn't work for me either. It runs fine, but never sends the e-mail. So I hoped to gain a better understanding of MAPI by directly working with it. I thought then I would be able to figure out why the ocx solution doesn't work. And help me to resolve any problems I run across in the future.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Frankly,

I think we're both better off trying to figure the issues with the msmapi32.ocx rather than the API version. They are approaching the task from widely different angles, so I doubt understanding the one issue will simplify understanding the other.

Does your msmapi32 sample differ significantly from the one I have attached here, if so, may you try this one (of course given that you modify the email adresses) and does it work? If it doesn't we will take it from there.

What you have to modify is:


       MOVE    "Recipient name"  TO MY-RECIP-NAME.
       MOVE    "Recipient email"   TO MY-RECIP-ADDR.


If it does work. Look at it, compare it to yours and see if you can pinpoint the difference. If not, let me look at yours and we will see if we can make this work.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Yes, that is very similar to the code I was using. I change MY-RECIP-NAME and MY-RECIP-ADDR, and it appears to run thru the program successfully but the e-mail does not reach the mail server. I don't know how to debug this to find my problem, which is why I thought if I could get the direct API approach to work, I would discover my problem.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Strange, and you get no errors at all? Are you sure the Outlook is readily configured and operational on that computer?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Not Outlook, but I use Outlook Express and I can send and receive mail fine. I thought these would work with more clients than Outlook?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Can you check if Outlook Express is set to be the default email client?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Problems with CobolMail and email.exe

Sorry, yes, I should have mentioned that. It is set as my default client. I have set it (and Netscape) to check to see it if it the default when it starts.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.