www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/11/06:30:21

From: "Olaf van der Spek" <Olaf AT XCC DOT TMFWeb DOT NL>
Newsgroups: comp.os.msdos.djgpp
References: <yG3a5.322335$k22 DOT 1427482 AT flipper>
Subject: Re: Pipe to sendmail (again)
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <56ga5.329089$k22.1448044@flipper>
Date: Mon, 10 Jul 2000 08:49:05 GMT
NNTP-Posting-Host: 213.46.21.6
X-Complaints-To: abuse AT chello DOT nl
X-Trace: flipper 963218945 213.46.21.6 (Mon, 10 Jul 2000 10:49:05 MET DST)
NNTP-Posting-Date: Mon, 10 Jul 2000 10:49:05 MET DST
Organization: Chello Broadband
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I tried this:
#include <cstdio>
#include <cstdlib>
#include <iostream>

int main()
{
 FILE* mail = popen("/usr/sbin/sendmail \"WSpek AT Chello DOT NL\"", "wt");
 cout // << errno << endl
  << mail << endl;
 return 0;
}

And it still doesn't work. Without the \" it doesn't work either.

"Olaf van der Spek" <Olaf AT XCC DOT TMFWeb DOT NL> schreef in bericht
news:yG3a5.322335$k22 DOT 1427482 AT flipper...
> Hi,
>
> I tried the following code with g++ on a Unix Apache server.
> #include <cstdio>
> #include <cstdlib>
> #include <iostream>
>
> int main()
> {
>  FILE* mail = popen("/usr/sbin/sendmail", "tw");
>  cout // << errno << endl
>   << mail << endl;
>  return 0;
> }
>
> The errno is commented because g++ complained about an undeclared
> identifier.
> I get NULL as result, meaning the pipe couldn't get opened.
> When I use system("/usr/sbin/sendmail"); it starts fine, meaning that it's
> accessible.
>
>
> --
>
> Olaf van der Spek
> Almere, Holland
> Olaf AT XCC DOT TMFWeb DOT NL
> http://xcc.tiberian.com/
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019