Email IFS File

5 pts.
Tags:
Email
IFS
IFS Folder
Does anyone have code to email an IFS file. The SNDDST only works with files in qdls

Answer Wiki

Thanks. We'll let you know when a new response is added.

From IBM i V7.1+ you can use the native IBM i command : SNDSMTPEMM


By native I mean, it comes quietly packaged with the operating system. You can now send emails from within programs or from the command line by simply entering the command. Attach any kind of files from the IFS (PDF, TXT, HTML, XML, yadda yadda) and you can even format the body of the emails using HTML to make it look all pretty.

Discuss This Question: 5  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

    SNDDST generally shouldn't be used for "e-mail". It's a handy short-cut for very basic needs. It is not, however, an e-mail solution in general.

    Send MIME Mail (QtmmSendMail) API or the Create and Send MIME E-mail (QtmsCreateSendEmail) API are better choices. Or use JavaMail. Any of those can form the basis for home-grown solutions for sending e-mail. You can even completely write your own with sockets and other APIs.

    Or download and install one of the various free e-mail utility products, or purchase a commercial product.

    For most purposes, the biggest problem is in generating base64 or other appropriate encoding of any documents that you want to attach or creating the proper MIME headers. Those are problems that commonly make SNDDST inappropriate and cause sites to rely on 3rd-party solutions.

    Are you interested in using a product? Should it be commercial and supported by a vendor? Or would a free utility be sufficient?

    Tom

    125,585 pointsBadges:
    report
  • CLK

    I am sending both .csv and .xls files from the IFS.  The files are created programmmatically in the tmp folder and then copied in the CL program to the qdls\download folder to be sent using SNDDST.  I do find it necessary to create the file and copy it to the QDLS directory in one program and then submit a job to do the SNDDST, specifying allow multiple threads = no [ALWMLTTHD(*NO)]

    I'm assuming at this point that you have SNADS all set up and can send a file from the IFS that is in the QDLS directory.

    While the ability to use MMAIL may be preferred not everyone has that option and we have been using the SNDDST method for several years with no problems to both internal and external email addresses.

    50 pointsBadges:
    report
  • TomLiotta
    While the ability to use MMAIL may be preferred not everyone has that option...

    Since it's free, there aren't many good reasons not to have that option, or to have one of the alternative free options.

    E.g., the SNDM utility is available for free, and the download is just a savefile of a library with source files. No compiled objects are downloaded, so loading on a system is no different from storing a text document in a //home directory.. Even if never compiled, the source could be used to learn one way of coding a base64-encoding procedure and a way to generate appropriate MIME headers.

    When some reason does exist, that's when one of the mail APIs mentioned above is useful. The APIs are also free. (They don't have to be used. Programming can be done directly down to the sockets and IFS API level, as the SNDM utility shows.)

    And if no programming can be done at all to take advantage of the APIs, then the restrictions of SNDDST can't be ignored. They simply have to be lived with.

    Tom

    125,585 pointsBadges:
    report
  • TomLiotta
    Good point on the recent SNDSMTPEMM command, available for both i 6.1 and 7.1 by PTF if it's not already on your system. Documentation can be scant, but a useful discussion is available in Let Users Instantly Access SNDSMTPEMM Command Instructions with links through IBM to some specific command details. -- Tom
    125,585 pointsBadges:
    report
  • HarryPringle

    SNDSMTPEMM is limited to a 400 character message (Note parameter).  If you use HTML tags to format the message, there are not many characters left for the message itself.

    10 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