Author Topic: Removing an address from all lists at once  (Read 3875 times)

scottscomp

  • Posts: 18
    • View Profile
Removing an address from all lists at once
« on: November 14, 2007, 10:31:35 pm »
Hey Dean and others!  Thanks for all your help and the most awesome list mailer ever.  =)


Right now I'm using this PHP script to automatically remove an address from a list when a particular email address is "posted" to a page:

if($_POST['email']) {  //Checks to see if email was posted

$emailaddr = $_POST['email'];    //Let's call it emailaddr

$fp=fopen("http://www.mydomain.com/mail/rem.php?r=50&email=$emailaddr&dodel=1",'r');     //removes it from List #50

fclose($fp);    
}


This has been working GREAT.  But, is it possible to have the user removed from "all" lists at once instead of just one list at a time?


-Scott

mike2

  • Posts: 193
    • View Profile
Removing an address from all lists at once
« Reply #1 on: November 15, 2007, 10:20:40 am »
This has nothing to do with your question, but this line in your code isn't needed...
Code: [Select]
$emailaddr = $_POST['email']; //Let's call it emailaddr

When you call the remove URL, just use the $_POST['email'] variable... like:
Code: [Select]
$fp=fopen("http://www.mydomain.com/mail/rem.php?r=50&email=$_POST['email']&dodel=1",'r'); //removes it from List #50

Never said I was a great PHP programmer, but that may save like .00000001ms of execution each time... lol... :lol:

scottscomp

  • Posts: 18
    • View Profile
Removing an address from all lists at once
« Reply #2 on: November 15, 2007, 05:00:02 pm »
Fancy meeting you here Mike, I just signed up for your extreme lead program.  =)   My old server is crashing under the number of emails being sent - I need to find a way to slow things down (probably start using mail() with delays instead of smtp...) but things look good so far.

Thanks for the tip.  =)  yes I was aware of that but 'emailaddr' just looked better to my eyes... go figure...

mike2

  • Posts: 193
    • View Profile
Removing an address from all lists at once
« Reply #3 on: November 15, 2007, 05:14:48 pm »
Ha well hello, I didn't realize that, small world I guess.  I've been an LMP user for YEARS... since 2002 I believe.  Am fairly active in here, try to help when I can.

If mail with delays work cool, if not maybe a dedicated server is the way to go.

As for the code goes, I've just been learning PHP and just happened to notice that.  I try to code for max performance when I can.

Anyway, I'm sure Dean will answer on how to make that remove from all lists.

scottscomp

  • Posts: 18
    • View Profile
Removing an address from all lists at once
« Reply #4 on: November 15, 2007, 05:46:26 pm »
I've been an LMP addict for years too.  and it's already on a dedicated server that's only sharing with a few other sites.. .it's a P4 2.6ghz with 1.5GB of RAM on a 10mbps port.

It seems like it'll send 2-3 thousand emails before "crashing"..  during the "crash", the server is still up (can still be pinged, etc.) but it doesn't dish up any websites.. like only the httpd service quits.

Either way it's neither here nor there - I'm getting a new and faster dedicated server soon.

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Removing an address from all lists at once
« Reply #5 on: November 16, 2007, 12:10:51 am »
Hi Scott,

Thank you for your kind comments!

While there is a way to set options on remove link message codes to remove users from all lists, there is not a way to remove users from all lists with the form method.

Are you running the script on the same site as ListMail?  If so, some custom code could connect to the database, search for the lists the user is on and loop the fopen() call.  I can assist with that code if you need help.

A server with your specs should be able to be optimized so it doesn't crash under that relatively small load.  Some servers with less can send upwards of 1 million emails per day.  It's all in how the software is configured.  Do you know which MTA (mail server software) your server uses?  Typically the queue folders need to be split up, as a directory with just a couple thousand files will cause noticeably-delayed hard drive access time with system-wide delays to the point of what you described.

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

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

mike2

  • Posts: 193
    • View Profile
Removing an address from all lists at once
« Reply #6 on: November 16, 2007, 07:18:38 am »
Yea as Dean stated above that server shouldn't choke at 2-3k... unless maybe there is a bandwidth limit being hit and that's why it won't serve up sites?

Are you SSH'd onto the box while it's mailing to check it's load?

I guess we ( or I ) should first ask what operating system the box is running?

It definitely needs optimized starting with the MTA, then probably MySql and then maybe Httpd ( probably not much to do here if anything ).

Find out what MTA, make the necessary tweaks and then search here for the MySql optimizations as well.

Good luck