Hello everyone,
I've just subscribed to the list, and I already have a question.
what I need to do is to send mail using sockets. Actually, the
built-in Mail() function is great and I wouldn't have to search for
something else if I didn't need more than one message to be sent at a
time. Say, I have ten or a hundred of users who want to receive a
notification about new blog entries. If I use the mail() function in
the loop, it will be performed too slow since it constantly opens and
closes the door, I mean, the SMTP connection.
So I need an alternative.
And here's what I'm doing:

function socketmail($to, $subject, $message) { 
$from="Oire.org Administration <elens...@oire.org>";
    $connect = fsockopen ("smtp.yandex.ru", 25, $errno, $errstr, 30); 
if ($connect) {
$out="HELO localhost\r\n";
$out.="MAIL FROM: $from\n"; 
$out.="RCPT TO: $to\n";
$out.="Content-Type: text/plain; charset=utf-8\n"; 
$out.="To: $to\n"; 
$out.="Subject: $subject\n"; 
$out.=$message." \r\n"; 
fwrite ($connect, $out);
fclose ($connect);
} else {
die ("Error: ".$errstr." ($errno)");

socketmail ("arthae...@yandex.ru", "this is a socket mail test",
"Testing mail sending");

And what I get is absolutely nothing. No errors, no warnings, no
message in the mailbox.
So three questions:
1. What's wrong with my script?
2. How to look where the error exactly is? Can't get server logs for
some reason (will talk to tech support probably).
3. How to do the same thing but with an ability to send multiple
messages without closing the connection after each message?


With best regards from Ukraine,
Http://oire.org/ - The Fantasy blogs of Oire
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: http://twitter.com/m_elensule

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to