[PHP] mail() vs sockets

2003-02-07 Thread Jeff Busby
Question regarding php's mail function.

I've created a targetted mail system for a client, that uses the mail() function to 
send the the customer list.  I find it's ok for a few hundred names, however the 
client has a list of over 1 and I know that would be way to taxing on the server, 
as some tests have shown.  I got the following function off the php.net site and I'm 
wondering if something like this will be significantly more efficient than using the 
mail function.

function sendmail($to='', $subject='', $message='', $headers='', $extra='') {
 
 $fd = popen(/usr/sbin/sendmail -t $extra, 'w');

 fputs($fd, To: $to\n);
 fputs($fd, Subject: $subject\n);
 fputs($fd, X-Mailer: PHP4\n);
 
 if ($headers) {
  
   fputs($fd, $headers\n);
 }
 
 fputs($fd, \n);
 fputs($fd, $message);
 pclose($fd);
}

At this point using perl or another language is not an option.  Any advice or links 
would be appreciated.

Cheers,
Jeff.


Re: [PHP] mail() vs sockets

2003-02-07 Thread Paul Roberts
just post once

- Original Message - 
From: Jeff Busby [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 07, 2003 9:30 PM
Subject: [PHP] mail() vs sockets


Question regarding php's mail function.

I've created a targetted mail system for a client, that uses the mail() function to 
send the the customer list.  I find it's ok for a few hundred names, however the 
client has a list of over 1 and I know that would be way to taxing on the server, 
as some tests have shown.  I got the following function off the php.net site and I'm 
wondering if something like this will be significantly more efficient than using the 
mail function.

function sendmail($to='', $subject='', $message='', $headers='', $extra='') {
 
 $fd = popen(/usr/sbin/sendmail -t $extra, 'w');

 fputs($fd, To: $to\n);
 fputs($fd, Subject: $subject\n);
 fputs($fd, X-Mailer: PHP4\n);
 
 if ($headers) {
  
   fputs($fd, $headers\n);
 }
 
 fputs($fd, \n);
 fputs($fd, $message);
 pclose($fd);
}

At this point using perl or another language is not an option.  Any advice or links 
would be appreciated.

Cheers,
Jeff.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mail() vs sockets

2003-02-07 Thread Jeff Busby
Sorry, every time I posted I got an auto reply saying it had an attatchment
and it wasn't sent...and I had to post again.  The only way it worked was
for me to reply to another post and change the subject and message.  Didn't
mean to annoy anyone with multiple posts.


- Original Message -
From: Paul Roberts [EMAIL PROTECTED]
To: Jeff Busby [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, February 07, 2003 5:34 PM
Subject: Re: [PHP] mail() vs sockets


 just post once

 - Original Message -
 From: Jeff Busby [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, February 07, 2003 9:30 PM
 Subject: [PHP] mail() vs sockets


 Question regarding php's mail function.

 I've created a targetted mail system for a client, that uses the mail()
function to send the the customer list.  I find it's ok for a few hundred
names, however the client has a list of over 1 and I know that would be
way to taxing on the server, as some tests have shown.  I got the following
function off the php.net site and I'm wondering if something like this will
be significantly more efficient than using the mail function.

 function sendmail($to='', $subject='', $message='', $headers='',
$extra='') {

  $fd = popen(/usr/sbin/sendmail -t $extra, 'w');

  fputs($fd, To: $to\n);
  fputs($fd, Subject: $subject\n);
  fputs($fd, X-Mailer: PHP4\n);

  if ($headers) {

fputs($fd, $headers\n);
  }

  fputs($fd, \n);
  fputs($fd, $message);
  pclose($fd);
 }

 At this point using perl or another language is not an option.  Any advice
or links would be appreciated.

 Cheers,
 Jeff.


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mail() vs sockets

2003-02-07 Thread Jason Wong
On Saturday 08 February 2003 06:39, Jeff Busby wrote:
 Sorry, every time I posted I got an auto reply saying it had an attatchment
 and it wasn't sent...and I had to post again.  The only way it worked was
 for me to reply to another post and change the subject and message.  Didn't
 mean to annoy anyone with multiple posts.

1) Don't attach attachments, most mailing lists strip them out.
2) Don't start a new post by replying to an old one.
3) Search archives for mass mailing (or similar) to see past discussions on 
this subject.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Everything you read in newspapers is absolutely true, except for that
rare story of which you happen to have first-hand knowledge.
-- Erwin Knoll
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mail() vs sockets

2003-02-07 Thread Jeff Busby
Thanks, but I know how  it works.

I'm on the Pear general list and the php db list.  I just join the php
general list...replied to the confirm email then posted my question. There
was no attatchments, it was a brand new email.  I did it 3 times and
received the same auto responder.  So the last time I replied to someone
elses email but changed the subject and body and I didn't receive the auto
responed.

I've been all over the net looking for advice on the subject I posted, and I
didn't want to waste any more time...thats y I posted to the listso mr.
wong.if you don't want to help medon't...but don't lecture me about
proper form on the news group plz.

- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 07, 2003 9:38 PM
Subject: Re: [PHP] mail() vs sockets


 On Saturday 08 February 2003 06:39, Jeff Busby wrote:
  Sorry, every time I posted I got an auto reply saying it had an
attatchment
  and it wasn't sent...and I had to post again.  The only way it worked
was
  for me to reply to another post and change the subject and message.
Didn't
  mean to annoy anyone with multiple posts.

 1) Don't attach attachments, most mailing lists strip them out.
 2) Don't start a new post by replying to an old one.
 3) Search archives for mass mailing (or similar) to see past discussions
on
 this subject.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Everything you read in newspapers is absolutely true, except for that
 rare story of which you happen to have first-hand knowledge.
 -- Erwin Knoll
 */


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php