Hello,

On 08/16/2002 10:45 PM, Justin French wrote:
> I wouldn't call this a real solution, since it relies heavily on specific
> server requirements and config changes.  Simple fact is that a LOT of PHP
> programmers are on shared servers, and their hosts would NOT want 50,000
> emails queued up on disk.  No way!!
> 
> I'd expect doing this frequently on a shared server would be the fastest way
> to get your account shut down.

Yes, very true. Actually on shared servers, most ISP would not allow you 
  to send messages to that many recipients even if you use just send one 
message in Bcc for all because in the end it will consume much bandwidth.

Some people think that working around the problem by sending just to a 
few hundred at a time will solve the problem, but they are just fooling 
themselves because it will still consume the same, if not more, bandwidth.

Another problem why shared server hosting companies forbid bulk-mailing 
is that they can't be sure if what people is sending is really solicited 
e-mail, even if you sware that it is. There is always the risk of having 
their IP ranges blacklisted by anti-spammers and they do not want to 
deal with that.

Many people are resorting to ADSL/cable lines for bulk-mail (solicited 
or not). Because of that, many ISP have included the IPs of those 
connection in the Dial-Up List which is basically used by many mail 
server administrators to refuse messages as they may be from hit-and-run 
spammers.

If you are really sending solicited e-mail, eitheir you use a server 
that you absolutely control or hire e-mail delivery hosting services 
that are meant for that purpose, despit they currently are not very cheap.

Regards,
Manuel Lemos

> on 17/08/02 6:37 AM, Daren Cotter ([EMAIL PROTECTED]) wrote:
> 
> 
>>I have found a solution to my bulk email problem. I'm
>>posting my solution simply because I spent nearly a
>>year finding it, and I KNOW there's many other people
>>in my same situation.
>>
>>First, a recap of my problem:
>>
>>I need to send personalized emails to my member list
>>on a daily basis. I use PHP to query the MySQL
>>database, and loop through the results using the
>>mail() function. Problem: very slow, browser/php times
>>out, etc.
>>
>>Solution:
>>
>>First, I configure sendmail to use "queueonly" as the
>>DeliveryMethod (see sendmail.cf) instead of
>>"background". Then, when my PHP script runs, mailings
>>simply get queued instead of actually delivered. This
>>is a x10 speed increase. My script queues
>>approximately 1,000 mailings per minute (a x10 speed
>>increase). Then, I modified the
>>/etc/rc.d/init.d/sendmail script to process the queue
>>every 5 minutes, instead of the default one hour. This
>>insures that the mailings actually get sent soon after
>>they're queued, and you won't have to wait for
>>important emails to come through.
>>
>>The problem with the above solution used to be this:
>>certain emails generated from my site (welcome emails,
>>password lookup emails, etc) need to be sent
>>IMMEDIATELY, and cannot wait in the queue for 5
>>minutes. The solution for this: not using the built-in
>>mail() command in PHP. I created my own mail script
>>(by modifying something someone else already did)
>>which opens a socket directly with the mail server.
>>Code is below.
>>
>>// Sends the email directly to the mail server using
>>SMTP. This is done
>>// so sendmail can be setup using the queue method on
>>the server, and
>>// confirmation emails, etc, can be sent immediately
>>to the member.
>>function smtp_mail($to, $from_name, $from_email,
>>$reply_to_email, $subject, $body) {
>>$smtp = fsockopen("your_mail_server_here", 25);
>>if ($smtp == 0)
>>return 0;
>>fputs($smtp,"helo
>>machines_host_and_domain_name_here\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"mail from: $from_email\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"rcpt to: $to\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"data\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"From: $from_name <$from_email>\r\n");
>>fputs($smtp,"Reply-To: $reply_to_email\r\n");
>>fputs($smtp,"To: $to\r\n");
>>fputs($smtp,"Subject: $subject\r\n");
>>fputs($smtp,"\r\n");
>>fputs($smtp,"$body\r\n");
>>fputs($smtp,".\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp, "QUIT\r\n");
>>fclose($smtp);
>>return 1;
>>}
>>
>>Function is called as follows:
>>
>>if (!smtp_mail("recipient_email_here",
>>$EMAIL_FROM_NAME, $EMAIL_FROM_EMAIL,
>>$EMAIL_FROM_REPLY_TO, $SIGNUP_VALIDATION_SUBJECT,
>>"Test Body")) {
>>print "error: mail not sent";
>>} else {
>>print "it worked!";
>>}
>>
>>Hope this helps others!
>>
>>__________________________________________________
>>Do You Yahoo!?
>>HotJobs - Search Thousands of New Jobs
>>http://www.hotjobs.com
> 
> 



-- 

Regards,
Manuel Lemos


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

Reply via email to