1. TOMAZ KRALJ
  2. PowerBuilder
  3. Monday, 17 January 2022 20:42 PM UTC

Hello,

PB 2021.1288

I have issue with PBNI SMTP control from Topwiz, Roland Smith.

If I select to send email as HTML my attachment is not attached to mail. Receiver gets email where in the body is added name of file which should be attached but no attachment.  

If I send email as text than attachment is attached and everything is ok.

Does anyone know how to solve this?

 

Regards

Tomaz

 

 

Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 18 January 2022 18:49 PM UTC
  2. PowerBuilder
  3. # 1

In the send button it adds this line to the generated HTML:

"<img src='cid:attachment" + String(li_idx) + "'/>"

Having this in the HTML assumes that the attachment is an image file. When using PBNISMTP in your own program, make sure to only include this in the HTML if the attachment is an image that you want to appear somewhere within the message.

 

Comment
  1. Roland Smith
  2. Tuesday, 18 January 2022 18:52 PM UTC
Any image files that are included in the HTML in this manner will not be listed by the email client as an attachment.
  1. Helpful 2
There are no comments made yet.
· Baumann Accepted Answer Pending Moderation
  1. Tuesday, 18 January 2022 17:16 PM UTC
  2. PowerBuilder
  3. # 2

Hello

I had similar Problem with the SMTP mail object of Roland Smith, HTML Mails and Outlook.

If the body contains images, the attached files cannot be read in the Outlook mail client. The attached files are then interpreted as part of the body. In other mail clients it works.

I didn't find out why but I think it has something to do with encoding and decoding the mail.
My solution was to send a HTM email without pictures in it. This is not a good solution, but for me it works.

Regards

Karl

Comment
There are no comments made yet.
TOMAZ KRALJ Accepted Answer Pending Moderation
  1. Tuesday, 18 January 2022 19:44 PM UTC
  2. PowerBuilder
  3. # 3

Hello,

 

HTML looks like:

<html><body bgcolor='#FFFFFF' topmargin=8 leftmargin=8><h2>TESTNI MAIL</h2><br><h2>Faktura_FA_29_22.pdf</h2><br><img src='cid:attachment1'/></body></html>

 

So in mail I get Faktura_FA_29_22.pdf is part of body and not as attachement.

 

Regards

 

Tomaž

Comment
  1. Roland Smith
  2. Tuesday, 18 January 2022 20:12 PM UTC
The code in the Send button is just an example, there is no guarantee it will work in all cases. A PDF isn't an image file so it shouldn't be included in the HTML.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.