Re: Smtp Html Attachments

Giganews Newsgroups
Subject: Re: Smtp Html Attachments
Posted by:  Remy Lebeau \(TeamB\) (no.spam@no.spam.com)
Date: Fri, 20 Jun 2008

"W. Prinzjakowitsch" <c_e…@web.de> wrote in message
news:Xns9AC188FCDE985cepweb…@87.106.16.84...

> my problem is that every attachment works well except for JPGs.
> When I attach a JPG file i get the error *connection reset by peer*
> and no mail is sent.

Which version of Indy 10 are you using?  An earlier release had a bug in
TIdIOHandler.Write(TStream) when sending larger streams.  That was fixed in
a later release.

>      // PlainText, HTML, normal attachments, no HTML-related
> attachments

If you upgrade to a newer version, you can make use of the new
TIdMessageBuilderHtml class to simplify your code, ie:

    with TIdMessageBuilderHtml.Create do
    try
        PlainText.Text := sBody;
        Html.Text := sHtmlBody;
        Attachments.Assign(slAttachments);
        FillMessage(IndyMessage);
    finally
        Free;
    end;

Gambit

Replies

In response to

Smtp Html Attachments posted by W. Prinzjakowitsch on Wed, 18 Jun 2008