pokusao sam sa ovom (i sa jos par koje sam nasao na ovom forumu) ali nsita ne radi:
Code:
$set['naziv'] = "moj site online";
$set['admin_mail'] = "[email protected]";
function mailTo($to, $sub, $text)
{
global $set;
// Headers
$boundary = md5(uniqid(time()));
$headers = "Reply-To: ".$set['admin_mail']."\r\n";
$headers .= "From: ".$set['naziv']." <".$set['admin_mail'].">\r\n";
$headers .= "Return-path: ".$set['admin_mail']."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
$headers .= "Content-Type: multipart/alternative; \r\n";
$headers .= " boundary=\"----=_Part_".$boundary."\"\r\n";
$headers .= "\r\n------=_Part_".$boundary."\r\n";
$headers .= "Content-Type: text/plain; charset=ISO-8859-1; format=flowed\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "Content-Disposition: inline\r\n";
$headers .= "\r\n".strip_tags($text)."\r\n\r\n";
$headers .= "------=_Part_".$boundary."\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "Content-Disposition: inline\r\n";
$headers .= "\r\n".$text."\r\n\r\n";
$headers .= "------=_Part_".$boundary."--\r\n";
// Salje e-mail
$send = mail($to, $sub, '', $headers);
// Provjerava da li je e-mail poslan
if (!$send)
{
return false;
}
else
{
return true;
}
}
echo mailTo("[email protected]", "Pomozi mi", "<html><body><b>Ovo je jedan dugiii text!</b></body></html>");
$set['naziv'] = "moj site online";
$set['admin_mail'] = "[email protected]";
function mailTo($to, $sub, $text)
{
global $set;
// Headers
$boundary = md5(uniqid(time()));
$headers = "Reply-To: ".$set['admin_mail']."\r\n";
$headers .= "From: ".$set['naziv']." <".$set['admin_mail'].">\r\n";
$headers .= "Return-path: ".$set['admin_mail']."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
$headers .= "Content-Type: multipart/alternative; \r\n";
$headers .= " boundary=\"----=_Part_".$boundary."\"\r\n";
$headers .= "\r\n------=_Part_".$boundary."\r\n";
$headers .= "Content-Type: text/plain; charset=ISO-8859-1; format=flowed\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "Content-Disposition: inline\r\n";
$headers .= "\r\n".strip_tags($text)."\r\n\r\n";
$headers .= "------=_Part_".$boundary."\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "Content-Disposition: inline\r\n";
$headers .= "\r\n".$text."\r\n\r\n";
$headers .= "------=_Part_".$boundary."--\r\n";
// Salje e-mail
$send = mail($to, $sub, '', $headers);
// Provjerava da li je e-mail poslan
if (!$send)
{
return false;
}
else
{
return true;
}
}
echo mailTo("[email protected]", "Pomozi mi", "<html><body><b>Ovo je jedan dugiii text!</b></body></html>");
Ovo $set['admin_mail'] je postojeci mail koji se nalazi na istom serveru kao i skripta.
May the force be with you...