Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-05

Free Pascal librares for e-mail

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Cyril Zlachevsky

I need send e-mail messages from pascal program (in linux). But can't find any procedure or funtion for mailing in Free Pascal.

How I can solve my problem in fpc for linux?

Reply by email

John Coppens
to Cyril Zlachevsky

Hi Cyril,

I think the easiest way to send e-mail, is to directly call the unix sendmail program through an exec call. On one line you can include destination address, subject and body. Or you can prepare a simple file with the message data inside, and then call sendmail with exec.

John

Show quoted text 9 lines
I need send e-mail messages from pascal program (in linux). But can't find any procedure or funtion for mailing in Free Pascal. How I can solve my problem in fpc for linux? _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Alex
to John Coppens

HI, All!

I have res file with some components: RadioBoxes, CheckBoxes,... How can I change color of this elements in my dialog window?

Thnx 4 help!!!

Best regards, Alex ----------------------------------------------------- killall -9 lamers:))

Reply by email

Cyril Zlachevsky
to John Coppens: I think the easiest way to send e-mail, is to directly call the unix sendmail program…
John Coppens wrote 6 lines
Hi Cyril, I think the easiest way to send e-mail, is to directly call the unix sendmail program through an exec call. On one line you can include destination address, subject and body. Or you can prepare a simple file with the message data inside, and then call sendmail with exec.

I try to use this method but havent success: send
---cut---
tesing]$ cat 111.tmp
From:
X-X-Sender:
To: Cyril Zlachevsky
Reply-To: Cyril Zlachevsky
Organization: Don-Link ITSP
Subject: test
Content-Type:text/plain; charset=KOI8-R
test
.
tesing]$ cat mailproc.pp
uses dos;
begin

   Exec('/usr/sbin/sendmail.postfix','-U  < 111.tmp');

end.
tesing]$ ppc386 mailproc.pp
Free Pascal Compiler version 1.0.4 [2001/11/16] for i386 Copyright (c) 1993-2000 by Florian Klaempfl
Target OS: Linux for i386
Compiling mailproc.pp
Assembling program
Linking mailproc
3 Lines compiled, 0.0 sec
tesing]$./mailproc
---cut---
and after launch mailproc, only pressing '.' or Ctrl-Break can stop running program:
---cut---
tesing]$ps ax
[skip]
10239 pts/1 S 0:00 ./mailproc
10240 pts/1 S 0:00 /usr/sbin/sendmail.postfix -U < 111.tmp
10241 pts/1 S 0:00 /usr/sbin/postdrop -r
[skip]
---cut---

Any ideas? Maybe I'm going wrong way?

Show quoted text 11 lines
John On Fri, 17 May 2002 17:37:59 +0300 (EEST) Cyril Zlachevsky wrote: >I need send e-mail messages from pascal program (in linux). >But can't find any procedure or funtion for mailing in Free Pascal. > >How I can solve my problem in fpc for linux?

Reply by email

Arne Hanssen
to Cyril Zlachevsky
Cyril Zlachevsky wrote 22 lines
John Coppens wrote: > Hi Cyril, > > I think the easiest way to send e-mail, is to directly call the unix sendmail program > through an exec call. On one line you can include destination address, subject > and body. Or you can prepare a simple file with the message data inside, and > then call sendmail with exec. . tesing]$ cat mailproc.pp uses dos; begin Exec('/usr/sbin/sendmail.postfix','-U < 111.tmp'); end. > > On Fri, 17 May 2002 17:37:59 +0300 (EEST) > Cyril Zlachevsky wrote: > > >>I need send e-mail messages from pascal program (in linux). >>But can't find any procedure or funtion for mailing in Free Pascal. >> >>How I can solve my problem in fpc for linux?

I believe you are looking for the POpen procedure. Regrettably I do not have my code at hand, but as far as I remember you can do some- thing like:

var
  fd: text;
begin
  POpen(fd, '/bin/mail ', 'W');
  writeln(fd,"Subject: Test");
  {... other mailheaders/contents ...}
  PClose( fd );
end;

Check the docs - there may be an (working) example.

Vennlig hilsen / Best regards Arne Hanssen

Reply by email