Zoque.Forum
»
ataçlı email göndermek istiyorum
|
| Sunucu Tabanlı Programlama (Server Side) Perl/CGI, PHP, ASP, JSP, .NET ve diğer programlama dilleri hakkındaki sorularınıza, paylaşmak istediklerinize ve örnek kodlara bu alanda yer verebilirsiniz. |
![]() |
|
|
LinkBack | Seçenekler |
|
|
#1 (permalink) |
|
Üyelik Tarihi: 09.11.2006
Yer: izmir
Mesaj: 194
|
ataçlı email göndermek istiyorum
selam arkadaslar. ben sitemde mail formu ile insanların bana mail göndermesini saglıyorum. ben ona ekstra olarak dosyada ekleyebilmelerini istiyorum. bu konuda yardımcı olabilir misiniz? ben şöyle bir şeyleri arastırdım buldum ama calısmadı. belki yardımcı olur sizede benim göremedigim hatalar falan olabilir. ii çalışmalar herkese
HTML Code:
function sendmsg($to, $subject, $msgtext, $from, $file, $type)
{
$fp = fopen($file,"rb");
$fcontent = fread($fp ,filesize($file));
fclose($fp);
$content = chunk_split(base64_encode($fcontent));
$sep = strtoupper(md5(uniqid(time())));
$name = basename($file);
$header = "From: $from\nReply-To: $from\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: multipart/mixed; boundary=$sep
\n";
$body .= "--$sep\n";
$body .= "Content-Type: text/plain\n";
$body .= "Content-Transfer-Encoding: 8bit\n\n";
$body .= "$msgtext\n";
$body .= "--$sep\n";
$body .= "Content-Type: $type; name=\"$file\"\n";
$body .= "Content-Transfer-Encoding: base64\n";
$body .= "Content-Disposition: attachment; filename=
\"$file
\"\n";
$body .= "$content\n";
$body .= "--$sep--";
if (mail($to, $subject, $body, $header)) {
return true;
} else {
return false;
}
}
|
|
|
|
|
|
#2 (permalink) |
|
Re: ataçlı email göndermek istiyorum
İstediğin olayı bu uygulama ile gerçekleştirebilirsin.
__________________
onurkose.com |
|
|
|
|
Zoque'a hoşgeldiniz!