Jump to content
alogrep

Cannot get email with image inline

Recommended Posts

HI. I hoe there si sombody with Synapse experience willing to help.

I am trying to send an email with an embedded image.

The html is Trichview created.

In the richview part, I add the image like thi (MMis the is TMimeMess object from synapse)

    for i := 0 to HTMLImages.Count-1 do begin
      MM.AddPartHTMLBinary(HTMLImages[i].Stream,HTMLImages[i].Name,'<'+HTMLImages[i].Name+'>',MultiPartRel);
    end;

in the synpase part I have this funcion (by synapse)

function TMimeMess.AddPartHTMLBinary(const Stream: TStream; const FileName, Cid: string; const PartParent: TMimePart): TMimepart;
begin
  Result := AddPart(PartParent);
  Result.DecodedLines.LoadFromStream(Stream);
  Result.MimeTypeFromExt(FileName);
  Result.Description := 'Included file: ' + FileName;
  Result.Disposition := 'inline';
  Result.ContentID := Cid;
  Result.FileName := FileName;
  Result.EncodingCode := ME_BASE64;
  Result.EncodePart;
  Result.EncodePartHeader;
end;

So the disposition IS "inline", but the recipient get the image as an attachment. I really have no idea of what "CID" (Content ID) should be, i i just pass 

"<filename>" Wher filename is the filename of the embedded image.

Share this post


Link to post

Do you have in your HTML part something like

<img src="cid:FileName">

?

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×