1. David Peace
  2. PowerBuilder
  3. Thursday, 2 May 2024 16:33 PM UTC

Hi

We are converting from our old SMTP object (Rolands) to the new SMTPClient and we seem to be missing functionality. We are adding images in an email that are inline, but there is no option in the new smtp object to achieve this.

 

Looking at the old code it used 'Content-Disposition: inline;' as apposed to 'Content-Disposition: attachment;' to denote the different methods of inclusion. It also uses 'Content-ID: <attach.' + filename + '>' 

Am I missing something in the new smtp object or has this functionalty been missed and I need to ask for an enhancment?

Thanks

David

Accepted Answer
Daryl Foster Accepted Answer Pending Moderation
  1. Wednesday, 8 May 2024 02:34 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi David,

I haven't used the new SMTP objects so this might be totally irrelevant, but have you looked at the AddLinkedResource function?

https://docs.appeon.com/pb2022r3/powerscript_reference/addLinkedResource_func.html

It seems to be what you are looking for (as long as your html source has the related cid:xxxx in your img tags then it looks like it should work).

Regards,

Daryl.

Comment
  1. David Peace
  2. Wednesday, 8 May 2024 07:37 AM UTC
Thanks Daryl



I had not spotted that one :)
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 2 May 2024 16:49 PM UTC
  2. PowerBuilder
  3. # 1

The src value in the img tag must be "cid:xxx" where xxx is the same as the value in Content-ID. My example using 'attach.' isn't required, it could have been just the filename. cid is short for Content Id.

 

Comment
  1. David Peace
  2. Friday, 3 May 2024 10:40 AM UTC
Thanks for the clarification Roland. It seems that there is no way to do this witht he New PB SMTP methods.
  1. Helpful
  1. Roland Smith
  2. Friday, 3 May 2024 13:26 PM UTC
SMTP email is sent as text. Send an email with the SMTPClient object and in your mail client view the raw text of the message. Look to see if it assigns a content id to the attachment. If it does, you should be able to use a matching CID:XXXX in the HTML IMG tag of the body.
  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.