RE: I can't send an attachment using SMTP in Delphi 7
"Tom Hahn" <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <[email protected]> |
> -----Original Message----- > From: johnny_mmejia [mailto:[email protected]] > Sent: Wednesday, July 16, 2003 11:30 AM > To: [email protected] > Subject: [Delphi] I can't send an attachment using SMTP in Delphi 7 > > > > I'm using SMTP to send email and it is working fine for messages, but > I can't find the way to send an attachment file in Delphi 7. > If using Indy (TidSMTP, TidMessage) try the following: var EMailMsg : TidMessage; Attach : TIdAttachment; with MainForm.EmailMsg do begin // set up sender, address, subject, etc. Attach := TIdAttachment.Create(MessageParts,'file.txt'); Attach.FileName := 'file.txt'; // send FreeAndNil(TIdAttachment(Attach)); end; HTH, Tom ------------------------ Yahoo! Groups Sponsor ---------------------~--> Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more. http://www.c1tracking.com/l.asp?cid=5510 http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/i7folB/TM ---------------------------------------------------------------------~-> CodeCoffer - new Delphi code protection Tool! http://www.delphicollection.com/public/CodeCoffer.htm --------------------------------------------------------------- Unsubscribe:[email protected] List owner:[email protected] --------------------------------------------------------------- Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/