ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Wanted to send a JPEG company logo in email message.. Maybe intresting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wanted to send a JPEG company logo in email message.. Maybe intresting

    Experts,
    I am trying to send a quote with company logo in the email message ( NOTE: but, not as an attachment ).


    My quote ( with no logo ) is working good. So, lets just focus on just the logo part.


    1. I have a JPEG logo in the root directory. ( this is not an overlay, it is simply a JPEG ) file

    2. I created below HTML file ( LAN3.HTM) in the root directory
    Code:
    <!DOCTYPE html>                                                         
    <html>                                                                  
    <body>                                                                  
    <img src="/LANLOG7.JPG" alt="smiley face" height="800" width="800">     
    </body>                                                                 
    </html>
    3. Then, on my CL program, I run the below command ( we use ESEND )
    Code:
    ESEND/ESNDMAIL RECIPIENT(&EMAILTO) SUBJECT(&SUBJECT) +   
                 MSG(*ATT1) MSGTYPE(*HTML) +                 
                 ATTLIST(('cid:LAN3.HTM' *MSG +              
                 '/LAN3.HTM' *N * *LAST *ONLY))
    OR
    Code:
    ESEND/ESNDMAIL RECIPIENT(&EMAILTO) SUBJECT(&SUBJECT) +  
                 MSG(*ATT) MSGTYPE(*HTML) ATTLIST((* *NONE +
                 '/LAN3.HTM' *N * *LAST *ONLY))     */
    Both of the above 2 commands, does not display the logo on the email.


    But, if I run the above, command with JPG image, instead of HTML, it works
    Code:
     ESEND/ESNDMAIL RECIPIENT(&EMAILTO) SUBJECT(&SUBJECT) +  
                  MSG(*ATT1) MSGTYPE(*HTML) +                
                  ATTLIST(('cid:LANLOG7.JPG' *MSG +          
                  '/LANLOG7.JPG' *N * *LAST *ONLY))   */
    The reason, why I am referring to HTML is my quote is a HTML file.
    ESEND manual says, if we have multiple files, it should be in same format.

    Any help on why my HTML ( referring to JPG ) is not working?


    By the way, I contact ESEND onetime, but gentleman I spoke to is not of much helpful. It seems, he has a concern because the client I work for uses a older version.
    Maybe, the older version does not have this feature. I doubt on this, because my quote (HTML) with no logo is working good. My Logo with JPEQ is working good.
    But, the HTML referring to Logo is not working good.

    May be, the problem is on <img src="/LANLOG7.JPG" alt="smiley face" height="800" width="800">

    Thank You
    Stillin400

  • #2
    Re: Wanted to send a JPEG company logo in email message.. Maybe intresting

    After soooooooo many tries with trial and error, I am able to display both Logo and quote in email message body.
    Thanks

    Comment


    • #3
      Re: Wanted to send a JPEG company logo in email message.. Maybe intresting

      Would you care to share the solution?

      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: Wanted to send a JPEG company logo in email message.. Maybe intresting

        Sure GLS.

        I will be very glad to.

        My Quote from spool file is working good. It always shows up on the email message body. No issues there.

        For logo, Instead of using a HTML for LOGO, first I use he JPEG image directly. But, for some reason, I get all junk text, instead of LOGO image.

        Then I changed to GIF image, and both my LOGO, and quote shows PERFECT on the email message body.



        Below is the actual CL command
        ESEND/ESNDMAIL RECIPIENT(&EMAILTO) SUBJECT(&SUBJECT) +

        MSG('*ATT1 *ATT2') MSGTYPE(*HTML) +
        ATTLIST((* *NONE '/LANLOG8.gif' *N * +
        *LAST *ONLY) (* *NONE +
        '/QDLS/XXXXXXX/QOT120.HTM' *N * *LAST *ONLY))

        Comment


        • #5
          Re: Wanted to send a JPEG company logo in email message.. Maybe intresting

          I'm not familiar with this ESEND/ESNDMAIL command... perhaps it's a 3rd party product you've installed. Maybe it does some special processing to fix up the error you've created,

          But... in order for this to work properly, don't you need to refer to an inline image in the body of the message?! You say that you attached a JPEG and it showed as strange characters in the e-mail. This seems entirely normal to me, you're telling the e-mail reader that you're sending a message in HTML format -- and then you send a JPEG. It SHOULD show up as a bunch of characters, because if you try to treat a JPEG as an HTML documnet, that's exactly what it should do. If it were HTML, then the characters in he file should be displayed. The characters look like nonsense because the bytes that make up a JPEG image are not characters. So you should get junk. You've told it to treat binary data as characters.

          But, GIF should also do the same thing. It makes no sense that this works! Are you sure your message works with all e-mail clients??

          The way e-mail messages work is that they can be divided into "parts" (using a standard format known as MIME). The first part is typically the "body". Subsequent parts can be inline parts, or can be attachments. An attachment is intended as a file that's not shown in the e-mail, but the user can save to their hard drive, or open with another program. inline parts are intended to be displayed directly in the e-mail, which is what you're looking to do with this logo.

          The HTML should look something like this:
          Code:
          <img src="cid:logo">
          The 'cid' identifies this as an inline "Content-ID" (cid is short for content-id). The actual image itself needs to have an e-mail header line like this:
          Code:
          Content-type: image/jpeg (or gif as appropriate)
          Content-ID: <logo>
          You cannot typically insert these yourself, it has to be done by the e-mail software. The e-mail software inserts headings into each 'part' of the e-mail, you see... and these headings contain meta-information used by the e-mail client to interpret the message. Content-ID is one of these headings.

          If you are, indeed, writing the e-mail program yourself I'd be happy to give you more details (or even an example) on this. But I'm pretty sure it won't help you since you're using this ESEND/ESNDMAIL. In the case of that program, it would have to insert the headings for you -- and since I'm not familiar with that program, I can't tell you how to make it do that. You'd be better off asking the vendor (whomever supplies this program) how to make it do that.

          Comment


          • #6
            Re: Wanted to send a JPEG company logo in email message.. Maybe intresting

            FWIW ESEND is a Help/Systems product
            I'm not anti-social, I just don't like people -Tommy Holden

            Comment


            • #7
              Re: Wanted to send a JPEG company logo in email message.. Maybe intresting

              Thank you Scott for your reply.
              Sorry in delay in response.
              I am using ESEND tool just 4 months, so I am not aware of many other things.

              On my last posting, I did not use the content id.

              I converted the spool file to HTML
              ESEND/CPYSPLIFS SPLF(QUOTE120) JOB(&NBR/&USER/&JOB)
              TYPE(*HTML) STMF(&FNAME2) REPLACE(*YES)
              where as FNAME2 is my IFS folder/file name

              Then I send the email ( as a HTML email format ) using the command on my previous post

              Even though it worked, sporadically, some users raised issues, some customers just get the LOGO, and not the quotation.

              Then I remove the above command that converts my spool file to HTML, and directly refer my spool file.

              Here is the final command. In this, I refer directly the spool file for quotation part .

              This seems working so far. The customers are getting Logo and quotation.

              ESEND/ESNDMAIL RECIPIENT(&EMAILTO) SUBJECT(&SUBJECT) +
              MSG('*ATT1 *ATT2') MSGTYPE(*HTML) +
              ATTLIST((* *NONE '/LANLOG8.gif' *N * +
              *LAST *ONLY) (* *NONE *N QUOTE120 +
              &NBR/&USER/&JOB *LAST *ONLY))

              Thank You
              Stillin400

              Comment

              Working...
              X