Konular
Link Değişimi
Php
Mysql
Html
Javascript
Windows Vista
Program Anlatımı
Internet
Google
Windows 2003 Server
Komikler
Windows Xp
Isa Server
Network
Ofis Programları
Css
Photoshop
Donanım
Joomla
Youtube Video
Diğer Konular
Jquery

Linklerimiz
Eskişehir Emlak Center
Turkish Gullets
Hoteller Hakkında Eleştiri
Add Your Url
fethiye Otel Fiyatları
Kiralık Gulet Bodrum
Rhodes Ferryboat
Otel Maps
Otel iletişim
Boutique Gulets

 
php send mail fonksiyonu
<?php
function sendmail($to, $subject, $body, $file=NULL, $from='noreply@yourdomain.com', $additional='')
{
$boundary = 'SPROUT-19_16_18_15_21_20';
$headers = array();
$headers[] = 'From: ' . $from;
$headers[] = 'Reply-To: ' . $from;
if(trim($additional) !== '')
{
$headers[] = $additional;
}
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-Type: multipart/mixed; boundary="' . $boundary . '"';
$headers[] = 'Content-Transfer-Encoding: 7bit' . "\r\n";
$headers[] = "> This is a multi-part message in MIME format.\r\n";
$headers[] = '--' . $boundary;
// if there is html in the message, send it with the right settings and an alternative for crappy browsers
if(preg_match('/\<(html|body)/ims', $body))
{
$htmlbound = 'SPROUT-' . rand(100,9999);
$headers[] = 'Content-Type: multipart/alternative; boundary="' . $htmlbound . '"' . "\r\n";
$headers[] = '--' . $htmlbound;
$headers[] = 'Content-Type: text/plain; charset="iso-8859-1"';
$headers[] = 'Content-Transfer-Encoding: 7bit' . "\r\n";
$headers[] = strip_tags(preg_replace('/\<head\>(.+?)\<\/head\>/ims', '', $body)) . "\r\n\r\n";
$headers[] = '--' . $htmlbound;
$headers[] = 'Content-Type: text/html; charset="iso-8859-1"';
$headers[] = 'Content-Transfer-Encoding: base64' . "\r\n";
$headers[] = chunk_split(base64_encode($body));
$headers[] = "\r\n\r\n--" . $htmlbound . "--\r\n\r\n--" . $boundary;
}
else
{
$headers[] = 'Content-Type: text/plain; charset="iso-8859-1"';
$headers[] = 'Content-Transfer-Encoding: 7bit' . "\r\n";
$headers[] = $body . "\r\n\r\n";
$headers[] = '--' . $boundary;
}

// attach files if they are there
if($file !== NULL)
{
$files = (!is_array($file)) ? array($file) : $file;

foreach($files as $attachment)
{
if(!file_exists($attachment))
continue;
$path = pathinfo($attachment);
$headers[] = 'Content-Type: application/octet-stream; name="' . $path['basename'] . '"';
$headers[] = 'Content-Disposition: attachment; filename="' . $path['basename'] . '"';
$headers[] = "Content-Transfer-Encoding: base64\r\n";
$attach = chunk_split(base64_encode(file_get_contents($attachment)));
$headers[] = $attach;
$headers[] = '--' . $boundary;
}
}
return mail($to, $subject, '', implode("\r\n", $headers) . '--');
}
?>


ÖRNEK

<?php

// Send an html file
sendmail('someone@domain.ext', 'Title', 'HTML CONTENT HERE');

// Send an email with an attachment
sendmail('someone@domain.ext', 'Title', 'Check out this picture', 'image.jpg');

// Send an html style email with multiple attachments
sendmail('someone@domain.ext', 'Title', 'HTML GOES HERE', array('product.jpg', 'productdetails.pdf'));

// Send a plaintext email from joeschmoe@domain.ext
sendmail('someone@domain.ext', 'Title', 'PLAIN TEXT GOES HERE', NULL, 'joeschmoe@domain.ext');

?>
Böyyük Patron Tarafından 14-01-2009 Tarihinde Gönderilmiştir.   Bu Konuyu Yazdır
Kaynak : 

 

En Son Eklenenler
php
php css ve js dosyalarının cacheden okunmasını engellemek
php
Dosya çalıştırılabilir mi is_executable()
php
Dosya yazılabilir mi is_writable()
php
Dosya okunabilir mi is_readable()
php
Dosya mı, dizin mi is_file() ve is_dir()
php
php Dosya var mı file_exits()
php
PHP include ve require
php
PHP URL Kodları
php
php formlardan gelen verileri almak
php
php web sunucusu değişkenlerini öğrenmek
php
php class (nesne) oluşturmak
php
php dizileri sıralama asort() ve ksort()
php
Diziden kesit alma array_slice()
php
php Dizinin ilk elemanını silme array_shift()
php
php Dizilere değişken ekleme array_push()
php
php Dizileri birleştirme array_merge()
php
php Dizi değişkenleri kullanımı
php
php Dizi Değişken Oluşturmak
php
php Değişkenlerin kapsamı: global ve static
php
php Fonksiyona varsayılan değer vermek
php
php Döngüyü sürdürmek için continue deyimi
php
php Döngüyü sona erdirmek için break deyimi
php
php for döngüsü
php
php do..while döngüsü
php
php while döngüsü
php
php if veya switch kısa şekilde kullanma
php
php switch deyimi
php
php if Deyimi
php
php Tarih ve saat Verisi
php
php Sabit Değerler define
php
php Bir Arttırmak veya Azaltmak için
php
php Aritmetik işlemciler
php
php is_string() is_integer() is_double()
php
php intval(), doubleval(), doubleval()
php
PHP'de Degisken Turleri Kopyalama (Casting)
php
php değişkene atadığımız değerin türünü değiştirmek
php
php Veri Türleri
php
php Değişkenler
php
Include() ve Require() işlevleri
php
do ... while
İletişim : bpatron@codekodu.com
466864Kişi Tarafından Sitemiz Ziyaret Edilmiştir. 16 Kişi Online
Bugün 21 Saat 34 Dakikada Sitemizi Tekil 397 Kişi Ziyaret Etmiştir.
Dün Sitemizi Tekil 401 Kişi Ziyaret Etmiştir.
Sitemizi En Çok Tekil 13-07-2010 Tarihinde 482 Kişi Ziyaret Etmiştir.
Sitemizdeki bilgilerin büyük çoğunluğu alıntıdır.İlgili yazının yazarının veya kaynak sahibinin istemesi halinde ilgili yazı sitemizden kaldırılacaktır.
Sitemizin İmalatı Böyyükpatron Tarafından Yapılmıştır.