Cannot create attachment object

Giganews Newsgroups
Subject: Cannot create attachment object
Posted by:  Man Utd (NOalanpltseSP…@yahoo.com.au)
Date: Fri, 6 May 2005

I tried to create an attachment object with the following code:

fSMTP := TIdSMTP.Create(nil);
mailMessage := TIdMessage.Create(nil);
attachment.Create(mailMessage.MessageParts, 'mydoc.doc');  << access
violation
  ...

Any wrong with my code ?

Replies