Re: mail() on *nix using ssmtp or an external smtp server?

From: Date: Mon, 16 Aug 2004 13:16:59 +0000
Subject: Re: mail() on *nix using ssmtp or an external smtp server?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193925@lists.php.net to get a copy of this message
Hi Markus, do I get you right, you can't invoke mail() because php can't find the sendmail executable? perhaps this does the trick: function my_mail_inject($mail) { $sendmail = ini_get("sendmail_path"); if(!$sendmail) $sendmail = "/var/qmail/bin/qmail-inject"; $p = popen($sendmail, "w"); if($p) { fwrite($p, $mail); pclose($p); return 1; } return 0; } (this is something I acutally use on a beta-production-system.) $mail must contain a complete mail with all necessary headers. qmail-inject is ~ equal to sendmail -t (-i is ignored in qmail's sendmail.) this solution also helpep me out of my dilemma that php reformats mail and adds extra headers and so on. Here I have full control over all headers :o) Hope you see your qmail installation in chroot'd env. else: good luck. I know it's not an external mta to deliver. If this does not help you at all have a look at the sources and hack 'em 'till they fit your needs # Ste'reinvent the wheel'phan

« previous php.general (#193925) next »