Pozdrav,
Interesuje me da li ovako mogu da posaljem mail.
Probao sam na istu foru samo sa sendmail_path
Ovo iznad radi!
Hvala!
Interesuje me da li ovako mogu da posaljem mail.
Code:
<?
$a= "<font size='14'>PORUKA</font>";
$b = "test test";
$c = "[email protected]";
$d = "[email protected]";
$server_smtp = fsockopen("localhost",25);
if($server_smtp == TRUE){
function sendmail ($to, $from, $subject, $body) {
$smtp = "localhost";
$fd=fsockopen($smtp,25);
fputs($fd, "To: $to\r\n");
fputs($fd, "From: Test <$from>\r\n");
fputs($fd, "Subject: $subject\r\n");
fputs($fd, "Mime-Version: 1.0\nContent-type: text/html; charset=UTF-8\n\n");
fputs($fd, $body);
fclose($fd);
}
sendmail ($c, $d, $b, $a);
echo "POSLATO!";
}else{
echo "GRESKA!";
}
?>
<?
$a= "<font size='14'>PORUKA</font>";
$b = "test test";
$c = "[email protected]";
$d = "[email protected]";
$server_smtp = fsockopen("localhost",25);
if($server_smtp == TRUE){
function sendmail ($to, $from, $subject, $body) {
$smtp = "localhost";
$fd=fsockopen($smtp,25);
fputs($fd, "To: $to\r\n");
fputs($fd, "From: Test <$from>\r\n");
fputs($fd, "Subject: $subject\r\n");
fputs($fd, "Mime-Version: 1.0\nContent-type: text/html; charset=UTF-8\n\n");
fputs($fd, $body);
fclose($fd);
}
sendmail ($c, $d, $b, $a);
echo "POSLATO!";
}else{
echo "GRESKA!";
}
?>
Probao sam na istu foru samo sa sendmail_path
Code:
<?
$a = "<font size='14'>HEHE SAD RADI NA STARI NACIN</font>";
$b = "test test";
$c = "[email protected]";
$d = "[email protected]";
function sendmail($to, $from, $subject, $body){
$sendmail_path = "/usr/sbin/sendmail -t -i";
$fd = popen($sendmail_path,"w");
fputs($fd, "To: $to\r\n");
fputs($fd, "From: Test <$from> \r\n");
fputs($fd, "Subject: $subject\r\n");
fputs($fd, "Mime-Version: 1.0\nContent-type: text/html; charset=UTF-8\n\n");
fputs($fd, $body);
pclose($fd);
}
sendmail($c, $d, $b, $a);
?>
<?
$a = "<font size='14'>HEHE SAD RADI NA STARI NACIN</font>";
$b = "test test";
$c = "[email protected]";
$d = "[email protected]";
function sendmail($to, $from, $subject, $body){
$sendmail_path = "/usr/sbin/sendmail -t -i";
$fd = popen($sendmail_path,"w");
fputs($fd, "To: $to\r\n");
fputs($fd, "From: Test <$from> \r\n");
fputs($fd, "Subject: $subject\r\n");
fputs($fd, "Mime-Version: 1.0\nContent-type: text/html; charset=UTF-8\n\n");
fputs($fd, $body);
pclose($fd);
}
sendmail($c, $d, $b, $a);
?>
Ovo iznad radi!
Hvala!
Potpis
There's no place like 127.0.0.1