ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SMTP_SendMail with attachment

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

  • SMTP_SendMail with attachment

    Hi All,

    I want to ask regarding attachment filename using SMTP_SendMail.
    I already successfully send attachment but the filename received is not same, there is '3D' letters added in front of the filename.
    I send attachment filename 7771.ZIP, but attachment filename received become 3D7771.ZIP
    Here is the capture :

    #) Filename received
    Click image for larger version

Name:	email attachment received.png
Views:	242
Size:	25.5 KB
ID:	158161

    #) Code
    Click image for larger version

Name:	coding statement.png
Views:	197
Size:	27.3 KB
ID:	158162

    #) Debug - hexa
    Click image for larger version

Name:	body_hexa.png
Views:	209
Size:	37.9 KB
ID:	158163


    Thanks and Regards,
    Randy

  • #2
    It sounds like something is (incorrectly) converting it to quoted-printable format.

    Comment


    • #3
      Yes Scott, character 3D looks like hexadecimal ascii for quotes (").
      I already try change the filename, but nothing works.
      Is there any clue what should I check or debug?

      Thanks and Regards

      Comment


      • #4
        No, 3D is the equal sign (=) character in ASCII.

        In the email format known as "quoted printable" (please do not confuse this with "quotes") values can be escaped by =XX (where XX is the hex code).

        So 'filename=7771.zip' if escaped as quoted-printable would be 'filename=3D7771.zip' which sounds like what's happening in your case.

        I do not know why that would happen, I can only guess that something is wrong with the way you're formatting your message -- or that there's some other email software involved that is buggy.

        Comment


        • #5
          Hi Scott,

          What should I check regarding "I can only guess that something is wrong with the way you're formatting your message"?
          I want to try to start checking from that if you have any guidance (maybe related coding format, etc).

          Thanks and Regards

          Comment


          • #6
            I would send a message from an established mail client like Thunderbird or Outlook and compare it to one that you generated to see what might be different.

            Comment


            • #7
              Hi Scott..

              I'm back, I cannot send to other mail client for now because the connection is not opened.
              So, I tried to commtrace to mail server ip.
              I can't find anything wrong, here is the capture :

              Click image for larger version

Name:	image.png
Views:	141
Size:	86.4 KB
ID:	158294

              Regards

              Comment


              • #8
                I've not seen an email program where all of the headers are in capital letters. But, perhaps that doesn't matter.

                Your content-type is wrong. There's no such content-type as "*ZIP", and it shouldn't have blanks after the content-type.

                That's what I can tell with 5 seconds of looking at your screenshot... like I said before, I would try generating the same email from a trusted email client and comparing what it generates to what you are generating.

                Comment


                • #9
                  Thank you Scott for your help...
                  Really really appreciate it..

                  Thanks and Regards

                  Comment

                  Working...
                  X