From: "Tim \"Zastai\" Van Holder" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: Pipe to sendmail (like Perl) Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Message-ID: Date: Sun, 02 Jul 2000 18:15:47 GMT NNTP-Posting-Host: 213.224.63.5 X-Trace: afrodite.telenet-ops.be 962561747 213.224.63.5 (Sun, 02 Jul 2000 20:15:47 MET DST) NNTP-Posting-Date: Sun, 02 Jul 2000 20:15:47 MET DST Organization: Pandora - Met vlotte tred op Internet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Damian Yerrick wrote in message news:dc1vlskc3oc35ir4sld7ck0755jqftevkb AT 4ax DOT com... > On Sun, 02 Jul 2000 17:30:57 GMT, "Olaf van der Spek" > wrote: > > >So in C++, I tried: > >void send_mail(const string& from, const string& to, const string& subject, > >const string& body) > >{ > > ofstream mail; > > mail.open("|/usr/sbin/sendmail -oi -t"); > > if (!mail.is_open()) > > cout << "Can't open pipe to sendmail" << endl; > > mail << "To: " << to << endl > > << "From: " << from << endl > > << "Subject: " << subject << endl > > << body; > >} > > > >But that didn't work, I got the error "Can't open pipe to sendmail". > >Anybody knows how this could be solved? > > By not using DOS. DOS doesn't really support pipes like Eunuchs does. Actually, DJGPP's support for popen/pclose makes this very possible on DOS (see my other post). -- Hi, I'm a signature virus. plz set me as your signature and help me spread :)