Mapi - Sendmail

Samj

Member
I've been using the simple MAPI approach to send reports from my application out to users via email. The problem is that I'm attaching the report to the email and some users either aren't capable of opening attachments or their emails server, virus checker doesn't like the attachments and deletes them.

I'd like to show the reports in the body of the email. I'm able to get the contents of my text files from the hard drive into the body of the email but I'm losing the formatting like line feeds and carriage returns.

Any ideas of how to display a simple text file within the email rather than attaching it to the email?

Thanks,

Sam
 

Samj

Member
Okay nevermind. I've got this. I had it along, it was just Netscape's email client wouldn't take the carriage return. But, Outlook Express performs just fine.

RUN import-report.
RUN MAPI(INPUT "sender-addy@domain.com",
INPUT "receiver-addy@notherdomain.net",
INPUT "subject line",
INPUT email-body,
INPUT "").

PROCEDURE import-repoprt:
DEFINE VARIABLE text-in AS CHARACTER NO-UNDO.

INPUT STREAM s-in FROM VALUE(input-filename).
REPEAT:
IMPORT STREAM s-in UNFORMATTED text-in.
ASSIGN
email-body = email-body + "~012" + text-in.
END.
INPUT STREAM s-in CLOSE.
END PROCEDURE.

And the text file from the hard drive is in the body of the email rather than an attachment.
 
Top