Author |
Message |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Mon Nov 20, 2006 2:31 pm |
  |
Hi all,
How can i create a mail list which all users of the domain is registered?
And nobody send mail to the mail list, except creator.
Thanks... |
Last edited by mastertr on Wed Nov 22, 2006 2:29 pm; edited 1 time in total |
|
  |
 |
cigraphics

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti
|
Posted:
Mon Nov 20, 2006 9:03 pm |
  |
try with php/mysql and make a looping something like this
Code: | <?php
$query = mysql_query("SELECT * FROM `mail`");
while($row = mysql_fetch_array($query)){
mail("$row[to]", "MASS MAIL", "$_POST[message]");
}
?> |
Hope you know how to make the tables |
|
|
    |
 |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Tue Nov 21, 2006 6:58 am |
  |
i dont understand.
apache2triad's mail system has no SQL database.
users information is in a tab file.
and i dont know how to make a list.  |
|
|
  |
 |
cigraphics

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti
|
Posted:
Tue Nov 21, 2006 11:44 am |
  |
try to go to Code: | http://localhost/phpxmail |
user: postmaster@localhost or postmaster@domain.com
pass: the password that your typed when you installed a2t go to users and you have a mailing list i hadn't tried it but i think that could help you |
|
|
    |
 |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Tue Nov 21, 2006 11:49 am |
  |
i have already use phpxmail, it is very useful.
but there is no mass mail function. it has mailing list function but you must reenter all user one by one.
and there are 500 users  |
|
|
  |
 |
cigraphics

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti
|
Posted:
Tue Nov 21, 2006 11:54 am |
  |
i'm going to try to make a mass mailer from the mailusers.tab with php |
|
|
    |
 |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Tue Nov 21, 2006 12:16 pm |
  |
thanks a lot  |
|
|
  |
 |
cigraphics

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti
|
Posted:
Tue Nov 21, 2006 12:53 pm |
  |
i think i did it
Code: | <style type="text/css">
body {
color:#666666;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold;
font-size:12px;
background-color:#FFFFFF;
}
input, textarea {
border:1px solid #999999;
}
a {
text-decoration:none;
color:#990000;
}
</style>
<?php
switch($_GET['do']){
default:
?>
<table align="center"><tr><td>
<form action="?do=send" method="post">
<input type="text" name="subject" /> Subject<br />
<textarea name="message" cols="30" rows="10"></textarea> Message<br />
<input type="submit" value="Send" />
</form></td></tr></table>
<?php
break;
case 'send':
$mailusers = "PATH TO THE mailusers.tab";
$a = file_get_contents($mailusers);
$d = explode("\n", $a);
$i=0;
$s = count($d);
echo "Sending emails to $s users<br />";
for ($i=0; $i<$s; $i++){
$re = str_replace('"', "", $d[$i]);
$ex = explode(" ", $re);
$subject = htmlspecialchars($_POST['subject']);
$message = htmlspecialchars($_POST['message']);
mail("$ex[1]@$ex[0]", "$subject", "$message");
echo "Email sent to: <b>$ex[1]@$ex[0]</b><br />";
}
echo "<a href=\"javascript:history.go(-1)\">Back</a>";
break;
}
?>
<center>© 2004 - <?=date('Y');?> Copyright <a href="http://cigraphics.kb.ro">CIGraphics</a>.</center> |
change this
$mailusers = "PATH TO THE mailusers.tab";
to something like this
$mailusers = "C:\apache2triad\mail\mailusers.tab";
do not modify this part
Code: | $d = explode("\n", $a);
$i=0;
$s = count($d);
echo "Sending emails to $s users<br />";
for ($i=0; $i<$s; $i++){
$re = str_replace('"', "", $d[$i]);
$ex = explode(" ", $re); |
and this
Code: |
mail("$ex[1]@$ex[0]".....
|
|
|
|
    |
 |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Tue Nov 21, 2006 1:05 pm |
  |
got these message,
Notice: Undefined index: do in D:\apache2triad\htdocs\toplu.php on line 27
switch($_GET['do']){ |
|
|
  |
 |
cigraphics

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti
|
Posted:
Tue Nov 21, 2006 1:11 pm |
  |
try this one you must change $mailusers if the path is not correct and run localhost/form.php or domain/form.php |
|
|
    |
 |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Tue Nov 21, 2006 1:27 pm |
  |
you did it, it works so good.
thanks a lot CIG  |
|
|
  |
 |
cigraphics

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti
|
Posted:
Tue Nov 21, 2006 1:30 pm |
  |
|
    |
 |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Tue Nov 21, 2006 1:57 pm |
  |
i add these lines, because of damaging of the message. (end of two character)
is it true?
Code: |
if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {
$eol="\r";
} else {
$eol="\n";
}
..
..
..
$message .= $eol
mail(..
|
|
|
|
  |
 |
cigraphics

Joined: 21 Aug 2005
Posts: 148
Location: Romania, Pitesti
|
Posted:
Tue Nov 21, 2006 2:13 pm |
  |
or with nl2br
do this
$message = nl2br($_POST['message']);
i don't think that i understand what you are trying to say but you can contact me Code: | cigraphics123[at]yahoo[dot]com |
|
|
|
    |
 |
mastertr

Joined: 24 Jul 2006
Posts: 24
|
Posted:
Tue Nov 21, 2006 2:27 pm |
  |
new error
Fatal error: Maximum execution time of 60 seconds exceeded in D:\apache2triad\htdocs\toplu\send.php on line 62
what should i do? |
|
|
  |
 |
|