Author Topic: smtp throttling  (Read 5411 times)

sanj

  • Posts: 54
    • View Profile
smtp throttling
« on: April 26, 2007, 08:36:45 am »
hi,

I need to be able to send up to a max of 500 emails per hour using smtp
I just this post

http://listmailpro.com/forum/index.php?topic=32.msg110

which talks about smtp throttling but it was for the earlier version of LMP.
is this code still valid for the current version

if(($y % '100')==0 && $y <> sizeof($sendq)) sleep(25);

and what do I need to change in the code so that I can send 498 emails per hour.

thanks
sanj
Magnetic Therapy Natural Pain Relief for Arthritis, Back Pain and More... at http://www.worldofmagnets.co.uk

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
smtp throttling
« Reply #1 on: April 26, 2007, 09:20:45 am »
SanJ,

Yes, the code is still valid.  The example delays 25 seconds every 100 emails.

500 emails per hour would be one every 7.2 seconds.  To delay 14.5 seconds every 2 emails, use this code:
Code: [Select]
if(($y % '2')==0 && $y <> sizeof($sendq)) usleep(14500000);
Your other option is to simply disable SMTP sending and use the delays available for the alternative, PHP mail.

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

sanj

  • Posts: 54
    • View Profile
smtp throttling
« Reply #2 on: April 27, 2007, 03:04:40 am »
hi
sorry for being a bit thick here:
these are the last few lines of codes before the ELSE

   $errmsg .= $srvmsg;
        if($smtp_debug) logwrite($bugf,$srvmsg);
        $lastmsg = substr($srvmsg, 0, 3);
        if ($lastmsg <> "250") $error = 1; else $error = '';
       }
      }
     }

do i put the statement after the third closed bracket just above the else statement

thanks
Magnetic Therapy Natural Pain Relief for Arthritis, Back Pain and More... at http://www.worldofmagnets.co.uk

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
smtp throttling
« Reply #3 on: April 27, 2007, 09:56:25 am »
SanJ,

Can you show me the indent of everything by wrapping what you pasted in the [ code] and [ /code] forum tags?

http://listmailpro.com/forum/index.php?topic=32.msg110#msg110
Quote
Look for this line:
Code: [Select]
   } else {
     // use php mail()

Above the else statement is the SMTP loop. You can place your delays right before the text above.

Please let me know if you are still having troubles.
Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

sanj

  • Posts: 54
    • View Profile
smtp throttling
« Reply #4 on: April 30, 2007, 02:22:39 am »
hi this is where i've added the line of code. Is that o.k?
Code: [Select]

fputs($ssock, $themesg."\r\n.\r\n");
        $srvmsg = fgets($ssock, 1024);
        $errmsg .= $srvmsg;
        if($smtp_debug) logwrite($bugf,$srvmsg);
        $lastmsg = substr($srvmsg, 0, 3);
        if ($lastmsg <> "250") $error = 1; else $error = '';
       }
      }  
if(($y % '2')==0 && $y <> sizeof($sendq)) usleep(14500000);
     }
   
     else {
     // use php mail()
      $body = str_replace("\r\n","\n",$body);
      // echo htmlspecialchars("WINDOWS=$windows EMAIL=<b>$email</b> SUBJ=<b>$xsubj</b> BODY=<b>$body</b> HEADER=<b>$header</b><br>");


Another question:

How do I find the INACTIVE subscribers in my list.

Basically what I want is everytime I add a new follow up letter to my list, to have that letter send to EVERYONE, who has reached the end of all the emails - i.e the inactives.

thanks
sanj
Magnetic Therapy Natural Pain Relief for Arthritis, Back Pain and More... at http://www.worldofmagnets.co.uk

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
smtp throttling
« Reply #5 on: May 01, 2007, 08:40:59 am »
SanJ,

The code looks good.
Quote
Basically what I want is everytime I add a new follow up letter to my list, to have that letter send to EVERYONE, who has reached the end of all the emails - i.e the inactives.

Please read the followup help page carefully.
Quote
Adding Followups to the End of a Sequence
When you add a followup to a list where users have completed the sequence the users will be considered ready to receive the new followup the next day (providing you do not manually change the default new sequence #). To add a mandatory delay between the end of the sequence and the new followup, check the option "Reset all users on this followup to new delay" when adding. When you hit Save all users at the end of the sequence will receive the new delay. You can also apply this option when later editing the followup.

Please let me know if I can be of further assistance!

Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

sanj

  • Posts: 54
    • View Profile
smtp throttling
« Reply #6 on: May 02, 2007, 01:16:06 am »
thanks Dean,

Great support as usual

sanj
Magnetic Therapy Natural Pain Relief for Arthritis, Back Pain and More... at http://www.worldofmagnets.co.uk

prepress forums

  • Posts: 24
    • View Profile
    • http://prepressforum.com
This not working for me? Pls Help.
« Reply #7 on: May 08, 2007, 01:40:12 pm »
http://listmailpro.com/forum/index.php?topic=1851.0

I notice DW has a line that says,

Code: [Select]

if(($y % '1')==0 && $y <> sizeof($sendq)) sleep(19);


Notice says "sleep(19)"

Then later in the thread a user is posting code that says "usleep(14500000)"

I notice DW says put the code, line right above

Code: [Select]

    } else {
     // use php mail()


Then, later in the thread a user is posting code that is missing one bracket before the else?

So I have tried everything I saw at this point but I get same error, so I checked file permissions etc.  Not sure why mine won't work but would really like it if someobne can give me decisive help.  This is getting frustrating and it's not working.  Using sendmail is not good as hosts are looking at my messages as spam and it just isn't going well without SMTP server sending the mail.  I keep having to email the admins and let them know I am a legitimate mailer with opt in member base..  aaarrgghh.  Before going to sendmail so I could throttle I was sailing along fine but mail was going too fast for my service.
--
JP

http://prepressforum.com - corvette-forum - http://free-preflight.com - http://printing-quote.us - http://destin-florida-hotel.com - Destin Florida Forum
corvette forum, corvette z06 forum, corvette c6 forum, c5 corvette forum, prepress forum, postcards, brochures, destin florida hotels

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
smtp throttling
« Reply #8 on: May 08, 2007, 01:56:23 pm »
Let's keep new discussion to a single thread, if possible - thanks!
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

macaspeer

  • Posts: 4
    • View Profile
Throttling assistance needed
« Reply #9 on: February 12, 2009, 05:22:01 am »
Hi Dean,
   
I put in this code as directed (above) on the admin.php file - this is how I have it in the code:

if(($y % '2')==0 && $y <> sizeof($sendq)) usleep(14500000);


And this is the message I am getting back
--00:00:02--  
http://www.domain.com/lists/dailymail.php?pw=password
Resolving www.domain.com... 66.71.243 Connecting to
www.domain.com|66.71.243|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/dev/null'

     0K                                                        5.04 =17s

 00:00:23 (5.04 B/s) - `/dev/null' saved [87]



And it's showing all my messages are still remaining to be sent in the outgoing queue.


Any suggestions to make this work properly?

Thank you for your assistance.

Al