BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Indy 10 IdMessage text/html with unrelated attachment

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Matt Leonard
Guest





PostPosted: Thu Aug 10, 2006 6:48 pm    Post subject: Indy 10 IdMessage text/html with unrelated attachment Reply with quote



Hi,

I'm new to Delphi and Indy so apologies if I don't explain myself well. I am
trying to setup an email send routine for my application. The routine seemed
to work fine with the Delphi7 supplied version of Indy7 but now I'm having a
small problem. I am sending a html and plain-text email with an un-related
attachment, when the message arrives in my email client I now see the html
part as an attachment rather then just in the message body. I have probably
just missed something simple but my brain has now melted trying to find
what.

Indy7 received message:
www.mjleonard.me.uk/indy/indy7.jpg
www.mjleonard.me.uk/indy/indy7.txt

Indy10 received message:
www.mjleonard.me.uk/indy/indy10.jpg
www.mjleonard.me.uk/indy/indy10.txt

Here is the relevant Delphi code:
IdMessage1.ContentType := 'multipart/mixed';
textbody := TIdText.Create(IdMessage1.MessageParts, nil);
textbody.Body.Text := ProfDHTMLEdit1.PlainText;
textbody.ContentType := 'text/plain';
htmlbody := TIdText.Create(IdMessage1.MessageParts, nil);
htmlbody.Body.Text := ProfDHTMLEdit1.Source;
htmlbody.ContentType := 'text/html';
attachment := TIdAttachmentfile.Create(IdMessage1.MessageParts,
'c:\attach.txt');


Thanks for looking,

Matt Leonard
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Aug 10, 2006 10:13 pm    Post subject: Re: Indy 10 IdMessage text/html with unrelated attachment Reply with quote



"Matt Leonard" <futurel (AT) gotadsl (DOT) co.uk> wrote in message
news:44db38cf (AT) newsgroups (DOT) borland.com...

Quote:
I am sending a html and plain-text email with an un-related attachment,
when the message arrives in my email client I now see the html part as
an attachment rather then just in the message body.

You are not setting the message up properly, so it is not being formatted
correctly. Please read the following article:

HTML Messages
http://www.indyproject.org/Sockets/Blogs/RLebeau/2005_08_17_A.en.aspx


Gambit
Back to top
Matt Leonard
Guest





PostPosted: Fri Aug 11, 2006 1:42 pm    Post subject: Re: Indy 10 IdMessage text/html with unrelated attachment Reply with quote



"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote in message
news:44db69f0$1 (AT) newsgroups (DOT) borland.com...
Quote:
You are not setting the message up properly, so it is not being formatted
correctly. Please read the following article:

HTML Messages
http://www.indyproject.org/Sockets/Blogs/RLebeau/2005_08_17_A.en.aspx


Gambit

Thank you for your prompt reply, I had been looking through the site but
somehow not come across that page before. It all works fine now, I knew I
had to be doing something silly.


Thanks,

Matt Leonard
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.