Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 May : Re: Socket Error # 10054 - Attached file

www.cryer.info
Managed Newsgroup Archive

Re: Socket Error # 10054 - Attached file

Subject:Re: Socket Error # 10054 - Attached file
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 22 May 2006 10:37:58

"Pablo Morales" <pmorales@alfabeta.net> wrote in message
news:446dd65d@newsgroups.borland.com...

>   unMensaje.Body.Clear;
>   unMensaje.Body.Assign(memo1.Lines);
>
>   tIdAttachmentFile.create(unMensaje.messageParts, 'c:\ver.sql');

You should not be using the Body property at all in this situation.  When
sending attachments, you must use the MessageParts for *all* content of the
message, including the body text.  Use TIdText for that, ie:

    unMensaje.Clear;

    unMensaje.From.Name := deTextoEdit.Text;
    unMensaje.From.Address := deMailEdit.Text;
    unMensaje.Recipients.EMailAddresses := edit2.Text;
    unMensaje.Subject := edit1.Text;
    unMensaje.ContentType := 'multipart/mixed';

    with TIdText.Create(unMensaje.messageParts, memo1.Lines) do
    begin
        ContentType := 'text/plain';
        // set other properties as needed ...
    end;

    with TIdAttachmentFile.Create(unMensaje.messageParts, 'c:\ver.sql') do
    begin
        // set properties as needed ...
    end;


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive