Hi Timur

and thank you for your reply. Yes, this is one possible solution, but I
prefer to use PHP's built in mail() function because of our webhosting
clients.

Petr Hruzek

-----Original Message-----
From: Timur I. Karimov [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 12:18 PM
To: Petr Hruzek
Cc: [EMAIL PROTECTED]
Subject: Re: XMail's sendmail replacement and PHP


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?

--
Best regards,
 Timur                            mailto:[EMAIL PROTECTED]



---
Poichozi zprava neobsahuje viry.
Zkontrolovano antivirovym systemem AVG (http://www.grisoft.cz).
Verze: 6.0.255 / Virova baze: 128 - datum vydani: 17.5.2001

Reply via email to