On 05-Jun-2001 Timur I. Karimov wrote:
> Hello Petr,
>
> Tuesday, June 05, 2001, 2:03:19 PM, you wrote:
> PH> I am trying to set up PHP4 with XMail's sendmail replacement, but I have
> no
> PH> success. From the command line sendmail works fine, but when I try to use
> PH> PHP's mail() function it does nothing. php.ini's variable sendmail_path
> is
> PH> set to /usr/sbin/sendmail, that is where my XMail's sendmail resides. If
> PH> anyone of you already successfully configured PHP with XMail, please send
> me
> PH> any suggestions.
> <?
> function SendMail($from,$fromemail,$subject,$to,$body)
> {
> flush();
> $nn="\r\n";
> $zapros=
> "helo elaz.ru".$nn.
> "mail from:".urlencode($from)."<".urlencode($fromemail).">".$nn.
> "rcpt to:<".urlencode($to).">".$nn.
> "data".$nn.
> "subject:".urlencode($subject).$nn.
> urlencode($body).$nn.".".$nn;
> flush();
>
> $fp = fsockopen("localhost", 25, &$errno, &$errstr, 30);
> if(!$fp) { print "$errstr ($errno)<br>\n"; exit; }
>
> fputs($fp,$zapros);
> while(!feof($fp)) {
> print fputs($fp,20048);
> }
> fclose($fp);
> }
>
> it's simple isn't?
Yes this will work but the XMail sendmail replacement is better coz does not
involve network communications between client and server.
- Davide