PHP’nin mail() fonksiyonu ile mail gönderebiliyoruz. Ancak bu fonksiyonla mail gönderdiğinizde Gmail gönderen ismini (unknown sender) olarak atayabiliyor. Bunu şu kod ile aşabilirsiniz;

ini_set(sendmail_from, $from);

Yani örnek bir mail gönderme kodu şöyle;

<?php
 
$name = "biraz kisisel"; //gönderen ismi
$from = "mail@birazkisisel.com"; //gonderen e-postası
$recipient = "huseyin@gmail.com"; // alıcının e-postası
$mail_body = "Merhaba, sitemize üye olduğunuz için teşekkürler. "; //mail içeriği
$subject = "Uyelik hakkinda"; //mail konusu
$header = "From: ". $name . " <" . $from . ">\r\n";
                   "Reply-To: $from" . "\r\n" .
                   "Content-type: text/html; charset=UTF-8\r\n" .
                   'X-Mailer: PHP/' . phpversion();
 
ini_set(sendmail_from, $from);
mail($recipient, $subject, $mail_body, $header);
?>
Tagged with:
 

Bir Cevap Yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

*

Şu HTML etiketlerini ve özelliklerini kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Set your Twitter account name in your settings to use the TwitterBar Section.