| View previous topic :: View next topic |
| Author |
Message |
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Mon Nov 20, 2006 2:31 pm Post subject: Mail List - Mass Mail Program included |
|
|
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... |
|
| Back to top |
|
cigraphics
Joined: 21 Aug 2005
Posts: 152
Location: Romania, Pitesti
|
| Posted: Mon Nov 20, 2006 9:03 pm Post subject: |
|
|
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 |
|
| Back to top |
|
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Tue Nov 21, 2006 6:58 am Post subject: |
|
|
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. :( |
|
| Back to top |
|
cigraphics
Joined: 21 Aug 2005
Posts: 152
Location: Romania, Pitesti
|
| Posted: Tue Nov 21, 2006 11:44 am Post subject: |
|
|
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 |
|
| Back to top |
|
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Tue Nov 21, 2006 11:49 am Post subject: |
|
|
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 :? |
|
| Back to top |
|
cigraphics
Joined: 21 Aug 2005
Posts: 152
Location: Romania, Pitesti
|
| Posted: Tue Nov 21, 2006 11:54 am Post subject: |
|
|
| i'm going to try to make a mass mailer from the mailusers.tab with php |
|
| Back to top |
|
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Tue Nov 21, 2006 12:16 pm Post subject: |
|
|
| thanks a lot :D |
|
| Back to top |
|
cigraphics
Joined: 21 Aug 2005
Posts: 152
Location: Romania, Pitesti
|
| Posted: Tue Nov 21, 2006 12:53 pm Post subject: |
|
|
i think i did it :D
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]".....
|
|
| Back to top |
|
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Tue Nov 21, 2006 1:05 pm Post subject: |
|
|
got these message,
Notice: Undefined index: do in D:\apache2triad\htdocs\toplu.php on line 27
switch($_GET['do']){ |
|
| Back to top |
|
cigraphics
Joined: 21 Aug 2005
Posts: 152
Location: Romania, Pitesti
|
| Posted: Tue Nov 21, 2006 1:11 pm Post subject: |
|
|
| try this one you must change $mailusers if the path is not correct and run localhost/form.php or domain/form.php |
|
| Back to top |
|
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Tue Nov 21, 2006 1:27 pm Post subject: |
|
|
you did it, it works so good.
thanks a lot CIG :D |
|
| Back to top |
|
cigraphics
Joined: 21 Aug 2005
Posts: 152
Location: Romania, Pitesti
|
| Posted: Tue Nov 21, 2006 1:30 pm Post subject: |
|
|
| no probl |
|
| Back to top |
|
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Tue Nov 21, 2006 1:57 pm Post subject: |
|
|
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(..
|
|
| Back to top |
|
cigraphics
Joined: 21 Aug 2005
Posts: 152
Location: Romania, Pitesti
|
| Posted: Tue Nov 21, 2006 2:13 pm Post subject: |
|
|
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 |
|
| Back to top |
|
mastertr
Joined: 24 Jul 2006
Posts: 24
|
| Posted: Tue Nov 21, 2006 2:27 pm Post subject: |
|
|
:oops:
new error :cry:
Fatal error: Maximum execution time of 60 seconds exceeded in D:\apache2triad\htdocs\toplu\send.php on line 62
what should i do? |
|
| Back to top |
|
| |