greysells
Новичок
из-за чего может тормозить скрипт отправки почты?
Здравствуйте.
Подскажите, из-за чего может тормозить вот этот скрипт отправки почты?
Выполняется минуты 2...
--------------------------------------------------------------------------------
<?
$file_name="logo.jpg";
$subj="Отправка изображения";
$bound="logo1234";
$headers="From: \"письмо\" <[email protected]>\n";
$headers.="To: [email protected]\n";
$headers.="Subject: $subj\n";
$headers.="Mime-Version: 1.0\n";
$headers.="Content-Type: multipart/alternative; boundary=\"$bound\"\n";
$msg="--$bound\n";
$msg.="Content-type: text/html; charset=\"windows-1251\"\n";
$msg.="Content-Transfer-Encoding: 8bit\n\n";
$msg.="
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
<html>
<head>
<title>Почта</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">
</head>
<body>
<div style=\" width:700px; font-family:tahoma; font-size:12px; padding:10px;\"><br>
<div align=\"center\"><img src=\"cid:kartina\"></div><br>
текст письма.
</body>
</html>";
$msg.="\n\n--$bound\n";
$msg.="Content-Type: image/jpeg; name=\"".basename($file_name)."\"\n";
$msg.="Content-Transfer-Encoding:base64\n";
$msg.="Content-ID: <kartina>\n\n";
$f=fopen($file_name,"rb");
$msg.=base64_encode(fread($f,filesize($file_name)))."\n";
$msg.="--$bound--\n\n";
if(mail("[email protected]", $subj, $msg, $headers)) echo "Сообщение отправленно!";
?>
--------------------------------------------------------------------------------
Здравствуйте.
Подскажите, из-за чего может тормозить вот этот скрипт отправки почты?
Выполняется минуты 2...
--------------------------------------------------------------------------------
<?
$file_name="logo.jpg";
$subj="Отправка изображения";
$bound="logo1234";
$headers="From: \"письмо\" <[email protected]>\n";
$headers.="To: [email protected]\n";
$headers.="Subject: $subj\n";
$headers.="Mime-Version: 1.0\n";
$headers.="Content-Type: multipart/alternative; boundary=\"$bound\"\n";
$msg="--$bound\n";
$msg.="Content-type: text/html; charset=\"windows-1251\"\n";
$msg.="Content-Transfer-Encoding: 8bit\n\n";
$msg.="
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
<html>
<head>
<title>Почта</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">
</head>
<body>
<div style=\" width:700px; font-family:tahoma; font-size:12px; padding:10px;\"><br>
<div align=\"center\"><img src=\"cid:kartina\"></div><br>
текст письма.
</body>
</html>";
$msg.="\n\n--$bound\n";
$msg.="Content-Type: image/jpeg; name=\"".basename($file_name)."\"\n";
$msg.="Content-Transfer-Encoding:base64\n";
$msg.="Content-ID: <kartina>\n\n";
$f=fopen($file_name,"rb");
$msg.=base64_encode(fread($f,filesize($file_name)))."\n";
$msg.="--$bound--\n\n";
if(mail("[email protected]", $subj, $msg, $headers)) echo "Сообщение отправленно!";
?>
--------------------------------------------------------------------------------