Mail isim ve grup adında üç adet alan oluşturuyorsunuz. maile mail adreslerini isime kullanıcı ismini ve grup a da grup id yi alıyorsunuz grup tablosundan. mailgrup tablosuda id ve grup isminden oluşuyor. Ben fck editörü kullandım siz istediğinizi kullana bilirsiniz. Resim adreslerini txt editöre <img src=http://kadinin.com/logo.gif/> şeklinde yazmalısınız.
Grup Tablosu
Mail Tablosu
1. toplumail1.php içine
2. toplumail.php içine
orjinal yazım sitemda : kadinin.com boş durmasın diye kullanıyorum 
Grup Tablosu
Kod:
CREATE TABLE `mailgrup` (
`id` int(11) NOT lisanssız auto_increment,
`grup` text NOT lisanssız,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
Mail Tablosu
Kod:
CREATE TABLE `mail` (
`id` int(11) NOT lisanssız auto_increment,
`grupid` int(11) NOT lisanssız,
`isim` text NOT lisanssız,
`mail` text NOT lisanssız,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;
1. toplumail1.php içine
Kod:
<table><tr><td width=”600″><form method=”POST” action=”toplumail.php”>
<p><?
echo ‘<select name=”grupid”>’;
echo(’<option value=”0″>Hepsi</option>’);
$kategoriler = mysql_query(”select * from mailgrup order by grup asc”) or die(mysql_error());
while($katego = mysql_fetch_array($kategoriler))
{
echo(’<option value=”‘.$katego[id].’”>’.$katego[grup].’</option>’);
}
echo ‘</select>’;
?> <br />
<input name=”baslik” type=”text” /><br />
<?php
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// $oFCKeditor->BasePath = ‘/fckeditor/’ ; // ‘/fckeditor/’ is the default value.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, “_samples” ) ) ;
$oFCKeditor = new FCKeditor(’mesaj’) ;
$oFCKeditor->BasePath = $sBasePath ;
$oFCKeditor->Value = ” ;
$oFCKeditor->Create() ;
?></p>
<p> </p>
<p><input type=”Submit” value=”Mail Gönder” name=”B1″><input type=”reset” value=”Temizle” name=”B2″></p>
</form>
</table>
2. toplumail.php içine
Kod:
<?
$mesaj = $_POST[mesaj];
$targetChars=array(’\\’);
$mesaj=str_replace($targetChars, “”, $mesaj);
$baslik = $_POST[baslik];
$grupid= $_POST[grupid];
if ($grupid==’0′) {
$kimegidiyor = mysql_query(”SELECT * FROM mail”); } else {
$kimegidiyor = mysql_query(”SELECT * FROM mail where grupid=’$grupid’ “);
}
while ($gidecek = mysql_fetch_array($kimegidiyor))
{
$mail =$gidecek[mail];
$isim =$gidecek[isim];
$fromemail=”[email protected]“;
$fromname=”Gönderen Kişi”;
$subject=$baslik;
$address=$mail;
$text=’
<html lang=”tr”>
<head>
<meta content=”text/html; charset=utf-8″ http-equiv=”Content-Type”>
<title>Gönderen Kişi</title>
</head>
<body>
Merhaba,<br />
Sayın’.$isim.’<br /><br />
’.$mesaj.’<br /><br />
www.kadinin.com<br /> mail adresi.com<br />
http://www.kadinin.com<br />
</body></html>
’;
$header = “From: Kadının Sitesi <[email protected]>\n”;
$header .= “X-Sender: <[email protected]>\n”;
$header .= “X-Mailer: kadinin.com, PHP\n”;
$header .= “X-Priority: 0\n”;
$header .= “Return-Path: <[email protected]>\n”;
$header .= “Content-Type: text/html; charset=iso-8859-9\n”;
mail($address,$subject,$text,$header);
echo “Mail Gönderildi $mail<br />”;
}
?>