Alaska Software Inc. - Embeded images in HtmlMail
Username: Password:
AuthorTopic: Embeded images in HtmlMail
Jack DuijfEmbeded images in HtmlMail
on Mon, 22 May 2017 23:14:29 +0200
Hello 

Did anyone figured out how to embed images in the html email as multipart ?

I tryed below without success.

I have message:
<HTML><HEAD><TITLE>Onderwerp van deze mail</TITLE>
</HEAD>
<IMG SRC="C:\Tmp\MailLogo.jpg" ALT="MijnLogo"><BR>
<BR>
Hallo relatie,<BR>
<BR>
Dit is een test HTML bericht met<BR>
een plaatje<BR>
</HTML>


cFile := "C:\Tmp\MailLogo.jpg"

      oContent    := MIMEContent():New()
      oContent    := oContent:CreateFromFile(cFile)

     cHtmlMessage := StrTran(cHtmlMessage,cFile,"cid:"+ oContent:UniqueString)

   oMail:SetHtmlMessage(cHtmlMessage)
   oMail:AttachMixed(oContent)


Whay am i doing wrong?
Regards
Jack Duijf

-------------------------------------------------------------
Also a member off the XXP (http://www.xxp.nl)
Thomas BraunRe: Embeded images in HtmlMail
on Tue, 23 May 2017 15:50:43 +0200
Jack Duijf wrote:

The identifier after "cid:" is what connects the html source to the
embeded/attached image file.

So instead of:

>    oMail:AttachMixed(oContent)

You probably should use:

oMail:attachRelated( oContent, oContent:UniqueString )

HTH
Thomas
Thomas BraunRe: Embeded images in HtmlMail
on Tue, 30 May 2017 10:01:26 +0200
Jack Duijf wrote:

> Hello 
> 
> Did anyone figured out how to embed images in the html email as multipart ?
> 
> I tryed below without success.
[...]
>    oMail:AttachMixed(oContent)
> 
> Whay am i doing wrong?

Hi Jack,

Did my suggestion work?

Thomas
Jack DuijfRe: Embeded images in HtmlMail
on Thu, 08 Jun 2017 17:49:22 +0200
Hello Thomas,

Thank you for the reply. It works now.
I also made a second error.
Just found that oContent:UniqueString is always diffrerent, even for the same object. !!
After some tweaks, i get it working ok now.

Thanks for your help.



On Tue, 30 May 2017 10:01:26 +0200, Thomas Braun wrote:

>Jack Duijf wrote:
>
>> Hello 
>> 
>> Did anyone figured out how to embed images in the html email as multipart ?
>> 
>> I tryed below without success.
>[...]
>>    oMail:AttachMixed(oContent)
>> 
>> Whay am i doing wrong?
>
>Hi Jack,
>
>Did my suggestion work?
>
>Thomas
Regards
Jack Duijf

-------------------------------------------------------------
Also a member off the XXP (http://www.xxp.nl)