Mail gonderme fonksiyonu;
PHP- Kodu:
function mail_gonder($gmail,$gadsoy,$gonmail,$konu,$mesaj) {
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-9\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "X-Sender: PHP\n";
$headers .= "From: $gadsoy<$gonmail>\n";
$headers .= "Reply-To: $gadsoy<$gonmail>\n";
$headers .= "Return-Path: $godsoy<$gonmail>\n";
@mail($gmail,$konu,$mesaj,$headers);
}
Kullanımı:
PHP- Kodu:
$kime="dubele@dubele.com";
$isim="Mehmet";
$soyisim="Goldenberg";
$bilgi=$isim." ".$soyisim;
$kimden="mehmet@goldenberg.com";
$konu="Bilgilendirm";
$tarih=date("d/m/Y");
$mesaj="Bu mail $soyisim, $isim tarafından $tarih adresinde gönderilmiştir";
mail_gonder($kime,$bilgi,$kimden,$konu,$mesaj);