Jump to content


Photo

Looking for "Mailing List" script


  • Please log in to reply
15 replies to this topic

#1 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 21 October 2006 - 11:47 PM

Hi. Sorry of this is not the right place to post this.

I'm looking for a script for a mailing list (i.e., "discussion", not "newsletter") that can be installed and run without the need for superuser privileges.

Any suggestions?

I've done a fair amount of looking and cannot tell without downloading and extracting the INSTALL file whether or not root access is required.

Thanks.

#2 ksteuber

ksteuber
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts
  • LocationCalifornia, USA

Posted 25 October 2006 - 10:22 PM

I'm not sure what you mean by

"discussion", not "newsletter"

but as for a mailing list, are you looking for something like this?
<?php
$mailinglist=file("mailinglistfile.txt");
$myemailaddress="example@domain.com";

$subject="The Subject of this Email";

$msg="Hello, I am sending you all this message.";

$headers='From: '.$myemailaddress."\r\n".'MIME-Version: 1.0'."\r\n".'Content-type: text/html; charset=iso-8859-1'."\r\n";
foreach($mailinglist as $theiremailaddress)
{
mail($theiremailaddress,$subject,$msg,$headers);
}
?>


#3 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 25 October 2006 - 11:20 PM

Thank you but that's not it.

A mailing list is one that has a central email address to which members send messages, which are then distributed to all members.

Like Listserv, Mailman, etc.

#4 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 26 October 2006 - 12:00 AM

store all the emails in a file and separate each on by a |

then do this

<?php
$to1 = explode("|", "filename.txt");
$to = $to1;
$youremail = your@email.com;
$subject= yoursubject;
$msg = yourmessage;
$headers='From: '.$youremail."\r\n".'MIME-Version: 1.0'."\r\n".'Content-type: text/html; charset=iso-8859-1'."\r\n";
mail($to,$subject,$msg,$headers);
?>


#5 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 October 2006 - 12:39 AM

I'm sorry for not being more clear.

The script resides on a server and runs unattended. When an email to the mailing list address arrives, the script picks it up, checks that the sender is a list member and then resends the body of the message.

For a better explanation, see

http://en.wikipedia....ic_mailing_list

Thanks.

#6 php_joe

php_joe
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 26 October 2006 - 04:31 PM

So, basicly you want to copy Yahoo Groups, right?

Use the code above, and modify it thusly:

<?php
$file = file_get_contents("filename.txt");
if(!eregi($youremail, $file)) die();
$to1 = explode("|", $file);
foreach($to1 as $key => $value){
$to = $value;
$subject= yoursubject;
$msg = yourmessage;
$headers='From: '.$youremail."\r\n".'MIME-Version: 1.0'."\r\n".'Content-type: text/html; charset=iso-8859-1'."\r\n";
mail($to,$subject,$msg,$headers);
}
?>

Let me know if it works :)

Joe
[url=http://darkswordsguide.com][/url]

#7 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 October 2006 - 06:18 PM

So, basically you want to copy Yahoo Groups, right?

No, i don't.

Use the code above, and modify it thusly:

<?php
$file = file_get_contents("filename.txt");
if(!eregi($youremail, $file)) die();
$to1 = explode("|", $file);
foreach($to1 as $key => $value){
$to = $value;
$subject= yoursubject;
$msg = yourmessage;
$headers='From: '.$youremail."\r\n".'MIME-Version: 1.0'."\r\n".'Content-type: text/html; charset=iso-8859-1'."\r\n";
mail($to,$subject,$msg,$headers);
}
?>

Let me know if it works :)

Joe


I have some questions about your script. The first is how do I get an email addressed to some user on the server where the script resides to trigger the script?

Thanks.

#8 php_joe

php_joe
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 27 October 2006 - 03:17 AM

I don't know how you'd do it via email but you could just make a webform and attach the variable $youremail to their email address and then put this script in the page that you submit to.

Joe
[url=http://darkswordsguide.com][/url]

#9 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 27 October 2006 - 03:00 PM

Thanks but that would require my intervention for every email sent to the list's email address.

I'm looking for something that runs unattended.

There are scripts on the script sites that let the list owner send a "newsletter" to a bunch of email addresses and I think that's what you've come up with.

My requirements are a bit different.

Actually, I think that there are scripts that already exist for this; I just cannot find them!

#10 Netty

Netty
  • Members
  • PipPip
  • Member
  • 12 posts
  • LocationLiverpool

Posted 27 October 2006 - 06:06 PM

search http://php.resourceindex.com
With Regards,

Annette

#11 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 27 October 2006 - 09:30 PM

search http://php.resourceindex.com

Thanks. That was one of the first places I looked. The descriptions are generally inadequate and it looks like the only way to find out if a script is suitable is to download it!

I was hoping that someone in this forum might have some experience with one or more of these existing script.

#12 ksteuber

ksteuber
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts
  • LocationCalifornia, USA

Posted 28 October 2006 - 01:57 AM

Somebody correct me if I'm wrong, but in order to run a php script, apache has to request the page (which is usually a result of a person's browser requesting the page), so if you want a script to resond to email rather than browser requests, wouldn't you have to somehow integrate PHP with a POP3 server.

I know Nothing about POP3 servers. Can you even do that?

#13 php_joe

php_joe
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 28 October 2006 - 03:53 AM

Thanks but that would require my intervention for every email sent to the list's email address.

No, you could set it up so that it's automatic. Just like this forum that sends emails to members who have "subsrcribed" to a particular topic.

Just give each member a "moderated" or "unmoderated" status and, if they're "unmoderated" have the code loop through a list of email addresses and mail() each one.

Joe
[url=http://darkswordsguide.com][/url]

#14 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 28 October 2006 - 03:55 AM

Thanks but that would require my intervention for every email sent to the list's email address.

No, you could set it up so that it's automatic. Just like this forum that sends emails to members who have "subsrcribed" to a particular topic.

Just give each member a "moderated" or "unmoderated" status and, if they're "unmoderated" have the code loop through a list of email addresses and mail() each one.

Joe

Way beyond my ability to code in PHP. Thanks.

#15 php_joe

php_joe
  • Members
  • PipPipPip
  • Advanced Member
  • 175 posts

Posted 28 October 2006 - 09:33 AM

It's not so hard. :)

When you're faced by a difficult project just break it into parts

When they're setting up their account have a code like this in the register page:
-------------------------------------------------------------------------
$profile = './accounts/{$username}_profile.php";
$address_list = './accounts/addresses.php";
if(!file_exists($path) { // does the profile already exist?
$new_profile_content = "<?\n\$status = \"unmoderated\";\n\$email = \"$register_email\";\n?>"; // what to put in the profile
$add_register_email = "$register_email\n"; // the user's email address with a line break added
$new_profile = fopen($path, "w"); // create the profile
fwrite($new_profile, $new_profile_content); // write the info
fclose($new_profile); // close the profile
$add_address = fopen($addresses, "a+"); // open the addresses.php
fwrite($add_address, $add_register_email); // add the address
fclose($add_address); // close addresses.php
}
-------------------------------------------------------------------------
(The register page will have to provide the $username and $register_email)

Then, when they submit a message at your webpage use this code:
-------------------------------------------------------------------------
$profile = './accounts/{$username}_profile.php";
$address_list = './accounts/addresses.php";
require "$profile"; // get their profile info
if($status == "unmoderated"){
$subject = 'the subject'; // your subject
$message = 'hello'; // your message
$headers = 'From: $email' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
$addresses = file($address_list); // turn addresses.php into an array
foreach($addresses as $key => $value){ // for each one...
$to = "$value";
mail($to, $subject, $message, $headers); // send them the message
}
} // all done!
-------------------------------------------------------------------------

Of course, this is just off the top of my head and may need some tweaking to work right.
[url=http://darkswordsguide.com][/url]

#16 eschamp

eschamp
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 28 October 2006 - 03:44 PM

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users