I want to send a DB2 file via email from AS400 to MS outlook using MMAIL/SENDMIME command.

70 pts.
Tags:
AS/400 File Sharing
CL Program
Microsoft Outlook
I want to send a DB2 file via email from AS400 to MS outlook.

 I use command MMAIL/SENDMIMe inside my CL program. I've 2 issues.

1. whenever an email reaches to recipient, it attaches some .dat file which doesn't have anything in it.

2. the attachment is in notepad, it removes the readability of columns. how will I send it as an excel or just introduce some space between columns. whichever is simpler with the less coding. 

thanks,

nutan.



Software/Hardware used:
AS400 - CL

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: 3  Replies

 
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
    What kind of attachment are you sending? If we don't know what you are sending and what MIME type you have assigned, we can't provide any good answers. Tom
    125,585 pointsBadges:
    report
  • Nutan
    I pull all the error messages from the message queue, and put it in DB2 file. I want to send this DB2 file as an email attachment.
    70 pointsBadges:
    report
  • TomLiotta
    I want to send this DB2 file as an email attachment. Yes, but what kind of attachment are you sending? SMTP e-mail servers handle ASCII printable characters only. All characters except printable ASCII characters or end of line characters must be encoded as, e.g., quoted-printable or Base64 encoded. And for MIME attachments, MIME headers need to be generated and included in the SMTP data stream to mark the beginning and end of attachments as well as to indicate the encoding type of that attachment. The whole "MIME"-related area of SMTP e-mail came about because SMTP servers only allow text to pass through. When people wanted to send binary files (e.g., image files) embedded in messages, methods of converting the binary bytes to text characters and back again were developed. If an attachment contains only ASCII printable text characters, it can be described as text. The attachment will have a name, probably including an extension. Your MIME header and encoding plus the extension that you assign to the name are the only elements that you can control as a sender. The recipient has control over how attachments are handled. Because of that, you want to be sure that you follow standards. You want to generate attachments with known extensions as much as possible. Your attachments need to be formatted to fit the specifications for the type that you assign. From your question: it attaches some .dat file which doesn't have anything in it. and the attachment is in notepad,... Are you saying that two separate attachments arrive? One attachment is a .DAT file that appears to be empty, and the other attachment is your data file which opens for the recipient in Notepad. If your data file opens in Notepad, it's because you are attaching it as a type that the recipient has configured to open in Notepad. What do you want it to open in? If you want it to open in Excel, then generate a .XLS or .CSV file. If you actually create a .CSV file and it opens in Notepad for the recipient, then it's because the recipient has configured his e-mail client to open .CSV files in Notepad. That is under the control of the recipient and there's nothing you can do to control it. You could include a note in your e-mail that says "Please open the attached .CSV file in Excel", but you can't make it happen. Even if you created a true .XLS file, you couldn't guarantee that it will open in Excel -- it would still open in Notepad if the recipient configured his client to do so. In short, what kind of attachment are you creating? What kinds of characters does it contain? What MIME type have you assigned? For me, I have a number of external e-mail accounts. When I'm creating functions to send e-mail, I send examples to a couple of those accounts and download the e-mails into files on a PC. Most e-mail clients let you save e-mail items as files. Then I open the files in Notepad and/or NoteTab and/or WordPad to see everything that was actually included in the physical e-mail item. If you don't look at the details by yourself, you really can't know what you are sending. 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