How to use QtmmSendMail API

240 pts.
Tags:
API
COBOL/400
QtmmSendMail
I want to use the API QTMMSENDMAIL for sending multiple attchments in a single email , the description for this API on IBM info centre says that one needs to save a file in IFS folder in the ASCII MIME format .

I am not aware about this format and how to convert a file of AS400 into this format .
I want my program to save a file as .csv in the IFS folder and provide the link to this API .

Will this work? IS .csv file a ASCII MIME compatible file ..

IF there is a example to use this API in COBOL will be much more appreciated , or example to convert a file to ASCII MIME format .


Software/Hardware used:
AS400 COBOL, API

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    ...IBM info centre says that one needs to save a file in IFS folder in the ASCII MIME format .

    I am not aware about this format and how to convert a file of AS400 into this format.

    To begin learning about MIME, start by reading the Wikipedia MIME article. There are various RFCs referenced in the article that tell you details.

    The SMTP protocol is intended to send only text consisting of 7-bit ASCII printable characters. (The protocol has evolved since it was first defined.) When the idea of attachments came along, many of them were binary, e.g., image files; and SMTP would not allow them to be sent. Various control sequences used ASCII characters outside of the 7-bit ASCII printable characters, and an SMTP server could be interfered with by sequences of bytes in binary files. For example, a binary file might contain bytes that just happen to have the same binary values as the bytes that mark the "end of message".

    Along with MIME is the idea of 'encoding'. The bytes in a binary file can be encoded in such a way that the information is represented by bytes that all come from the 7-bit ASCII printable character set. For a simple example, think about this:

    You might write a program that reads a binary file seven bytes at a time. The program can take the low-order 7 bits from each byte and use those to build 7 bytes of output by setting their high-order bits to zeros. The original single high-order bit from each byte can be used to build one extra byte of output by adding one high-order zero bit. The result is that seven bytes come into the routine and eight bytes go out of the routine. Every output byte now has zero for the high-order bit and each byte represents an encoded 7-bit character. Also, when those bytes are received, the receiving routine can convert each group of eight bytes back into the original seven bytes without losing any information.

    One of the most common methods of such encoding is "base64". Wikipedia can also explain how to learn about such encoding. If you look at the actual source of an e-mail item that contains a binary attachment, you can see that the attachment consists of nothing but plain printable characters. And if you detach and save the attachment, you can open the saved file in Notepad and see that the character set then contains many unprintable characters.

    The attachment is encoded while it is part of the e-mail. Before it is attached and after it is detached, it is in its native (or decoded) format. If you will be creating e-mail items, you are responsible for encoding and decoding any attachments that need it. Normally that is done by installing some utility that performs the work for you. You can search the internet for utilities that are available.

    Usually, complete e-mail clients are downloaded and installed.

    However, for a basic .CSV that contains only basic ASCII text characters, no encoding (other than ASCII) is needed. All that is needed is to add the basic MIME headers that identify the attachment as a text type and also add the the trailing sequence that identifies the end. If the .CSV is stored as CCSID 819, for example, you should be able to attach it as a MIME text type with no additional encoding.

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following