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?

Mailing lists / fpc-pascal / 2002-05
5 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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?
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
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!!!
I think the easiest way to send e-mail, is to directly call the unix sendmail program…
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?
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.