Hvala unapred na pomoći.
P.S.
Evo i koda:
Code:
function send_direct($server) {
$newline="\r\n";
$localhost='127.0.0.1';
$sh = fsockopen($server, 25, $errno,$errstr,15);
if (!$sh) {
$error= "Failed to connect to $server ". $errno . " | " . $errstr;
return $error;
}
$verify = fgets($sh, 128);
if (!preg_match("/220/",$verify)) {
$error="Verify Error, No connect string recieved | $verify";
return $error;
}
fputs($sh,"HELO $localhost".$newline);
fwrite($sh,"MAIL FROM: <$this->from>\r\n");
fwrite($sh,"RCPT TO: <$this->to>\r\n");
fwrite($sh,"DATA\n");
fwrite($sh,"From: <$this->from>\r\n");
fwrite($sh,"Content-type: text/html; charset=UTF-8\r\n");
fwrite($sh,"Reply-To:<$this->from>\r\n");
fwrite($sh,"Subject: $this->subject\r\n");
fwrite($sh,"To: $this->to\r\n");
fwrite($sh,"$this->text\r\n");
fwrite($sh,".\r\n");
$verify = fgets($sh,128);
if (!preg_match("/250/",$verify)) {
$error="Error: ". $verify;
return $error;
}
$success="Poruka poslata.";
fwrite($sh,"QUIT\r\n");
fclose($sh);
}
function send_direct($server) {
$newline="\r\n";
$localhost='127.0.0.1';
$sh = fsockopen($server, 25, $errno,$errstr,15);
if (!$sh) {
$error= "Failed to connect to $server ". $errno . " | " . $errstr;
return $error;
}
$verify = fgets($sh, 128);
if (!preg_match("/220/",$verify)) {
$error="Verify Error, No connect string recieved | $verify";
return $error;
}
fputs($sh,"HELO $localhost".$newline);
fwrite($sh,"MAIL FROM: <$this->from>\r\n");
fwrite($sh,"RCPT TO: <$this->to>\r\n");
fwrite($sh,"DATA\n");
fwrite($sh,"From: <$this->from>\r\n");
fwrite($sh,"Content-type: text/html; charset=UTF-8\r\n");
fwrite($sh,"Reply-To:<$this->from>\r\n");
fwrite($sh,"Subject: $this->subject\r\n");
fwrite($sh,"To: $this->to\r\n");
fwrite($sh,"$this->text\r\n");
fwrite($sh,".\r\n");
$verify = fgets($sh,128);
if (!preg_match("/250/",$verify)) {
$error="Error: ". $verify;
return $error;
}
$success="Poruka poslata.";
fwrite($sh,"QUIT\r\n");
fclose($sh);
}