RU/2: Форум. Общение пользователей и разработчиков OS/2 (eCS). : Ответить на сообщение
Имя:
e-mail:
FIDO:
Home page:
сохранить данные о вас
Тема:
> давным-давно набросал такую бяку, её и пользую: > > <? > > function SendMail($Server,$Port,$From,$To,$Header,$Subject,$Body) { > if (!$Server) $Server = 'localhost'; > if (!$Port) $Port = '25'; > if ($Header) $Header = "$Header\r\n"; > > $S = fsockopen($Server,$Port); > if (!$S) return FALSE; > fputs($S,"HELO $SERVER_NAME\r\n"); > $rs = fgets($S, 128); > $rc = fputs($S,"MAIL FROM:$From\r\n"); > $rs = fgets($S, 128); > $rc = fputs($S,"RCPT TO:$To\r\n"); > $rs = fgets($S, 128); > $rc = fputs($S,"DATA\r\n"); > $rs = fgets($S, 128); > $rc = fputs($S,"From: $From\r\n"); > $rc = fputs($S,"To: $To\r\n"); > // $rc = fputs($S,"Reply-To: $From\r\n"); > $rc = fputs($S,"Subject: $Subject\r\n"); > $rc = fputs($S,"Date: ".date('D, d M Y H:i:s', time())."\r\n"); > $rc = fputs($S,"$Header\r\n"); > $Body = ereg_replace("\n\.", "\n..", $Body); > $rc = fputs($S,"$Body\r\n"); > $rc = fputs($S,".\r\n"); > > $rc = fputs($S,"QUIT\n"); > $rs = fgets($S, 128); > fclose($S); > } > > function SendLetter($addr,$text) { > SendMail('ysout.sahen.elektra.ru', '25', 'common@sen.snc.ru', $addr, > "Content-Type: text/plain; charset=KOI8-R; format=flowed\r\nContent-Transfer-Encoding: 8bit", > 'http://common.sen.snc.ru', $text); > } > > ?>
__, _,_ _, __, ___,
|_) | | | |_ ` /
| \ | | | , | /
~ ~ `~' ~~~ ~~~ ~~~
Programmed by
Dmitri Maximovich
,
Dmitry I. Platonoff
,
Eugen Kuleshov
.
25.09.99 (c) 1999,
RU/2
. All rights reserved.
Rewritten by
Dmitry Ban
. All rights ignored.