Midrange News for the IBM i Community


Posted by: Jeff Masak
IT Developer
The Boldt Co
Appleton, WI
Adding URL Hotspot to email from iSeries (Not Attachment)
has no ratings.
Published: 07 Nov 2012
Revised: 23 Jan 2013 - 1670 days ago
Last viewed on: 20 Aug 2017 (5584 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Adding URL Hotspot to email from iSeries (Not Attachment) Published by: Jeff Masak on 07 Nov 2012 view comments(9)

Does anyone know how to add/insert a URL Hotspot to an email using a iSeries ?

 

I know how to, from the iSeries, place an attachment inside an email.

 

I am trying to send a PDF folder location (in place of All the PDF's) inside the email.

This would be a point and click (URL Hoptspot) pointing to a folder location on our network. 

Example:  \\newtwork\folder

 

Any help appreciated.

 

Thanks Jeff Masak

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: clbirk
Premium member *
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 13 days 7 hours 41 minutes ago

It doesn't matter if you are sending it from the i or a pc, etc. the email has to be an html email and you would simply put something like:

 

(a href="\\network\folder")click here for pdfs(a)  

 

I used ( ) instead of <> so that you could see such.

 

So the question is really how to do you tell whatever you are using to send the email to tell it that the body is html and not plain text, that depends on the tool you are using to send with.  Some email clients will figure it out on their own.

 

I use mailtool by bvstools and all I have to do is say: BDYCT('text/html')

chris

Posted by: TFisher
Premium member *
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 13 days 6 hours 2 minutes ago
Edited: Wed, 07 Nov, 2012 at 13:43:02 (1747 days ago)

Correct Chris,

The MIME email should be an HTML email, then you can do almost anything you want. 

I created an email API that we use here that allows us to create the email message in an HTML document stored on the IFS.  These are basically email templates that my API uses when it's building the MIME file.  These templates are linked to an email message ID that must be registered before they can be used.  Both my API and CL command allow an email message ID (or *NONE) to be specified. 

Since the email template is HTML we can embed images and links.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 12 days 12 hours 23 minutes ago

Along the lines of Fisher's API is MMAIL, which you can find on Easy400.net. This is a complete mail handling system, but it does have API's that allow you to roll your own.

Posted by: TFisher
Premium member *
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 12 days 10 hours 54 minutes ago

I am not very familiar with Easy400.net's MMAIL, and I am not trying to throw rocks at it, just be aware how it works before you install and use as is.  If it doesn't generate unqiue file names on the IFS then at some point you will experience problems with emails not being delivered to some people and/or wrong messages being delivered to the wrong people.

 

Someone here downloaded and used a command named SNDEMAIL that was published in some magazine.  I am sure that the article was simply showing how to build a MIME file and how to use the QtmmSendEmail API and wasn't intended to use as is.  That command was not designed to be used by several applications sending emails at the same time and we had several problems with that command.  It's not good when sensitive information about a customer is received by another customer!

 

Easy400.net's code is probably fine, I just wanted to point out that the MIME files and any spool files being converted for email attachments MUST be named uniquely or you may have problems.  I also see that they allow PDFs to be created from spool files.  Double check before implementing to confirm that their version supports overlays.  You don't want to start sending shipping documents or invoices with overlays.

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 12 days 3 hours 58 minutes ago
Edited: Fri, 09 Nov, 2012 at 11:00:26 (1745 days ago)

 

With help from my network guys, I was able to use the following, as a passed in parm, for the email body, from the iSeries: 

(We use software: 'LAUNCHER400' for creating this type of emails from the iSeries into Louts Notes)

<file://\\networkdrive\Current-Week-Rpts\Rpt0001-Created-11-08-2012.pdf

To get this to show correctly in this blog, I  had to put '<>' around the information above.

Also to get this to work correctly as Link insided an email, there cannot be spaces in the path, that is why there are '-' in the path.

Thanks for the help. 

Jeff

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 11 days 11 hours 43 minutes ago

You can have spaces, but you need to ESCAPE them. Normally SPACES are replaced with the plus sign (+) but you can also use the %20 which most people use in webmail URLs.

The difference is that a dash (or minus sign) as you have done must actually be in the file or path name, whereas when a PLUS or %20 is used, it would be an actual SPACE.

Posted by: jmasak
Premium member *
Appleton, WI
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 11 days 10 hours 11 minutes ago

Thank Bob, I did not know that about the (+) sign.  Will have to put that in my future bag of tricks.  Jeff

Posted by: Ringer
Premium member *
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 11 days 9 hours 55 minutes ago

"If it doesn't generate unique file names on the IFS..."

Easy400 does, for the MIME file it generates, in folder /mmail/temp. IFS File names are Q + next serial number .txt. Example: /mmail/temp/Q000000000008698.txt

But you are right, IFS attachments need to have unique names on the IFS. I usually plug in date/time/job number in there and/or a serial number or a tmpnam() and trim off the leading '/tmp/.

// temp name is like /tmp/QACXT3BFCJ
UniqueString = %Trim(%str(tmpnam(*omit)):' /tmp') ;

Chris Ringer

 

Posted by: TFisher
Premium member *
Comment on: Adding URL Hotspot to email from iSeries (Not Attachment)
Posted: 4 years 9 months 11 days 6 hours 46 minutes ago

Thanks for confirming that for us Chris!  I figured Easy400 probably generated unique names, but I wasn't sure...

I used tmpnam() for a while in my program, but I changed mine over to use _GenUuid() because I could never get an answer that tmpnam() would be a unique name or not.  I nevery had a problem with names generated by tmpnam(), but we have a lot more jobs running at the same time and generating emails now than we did three years ago when I made the change.  I just wanted to be sure.