function genSendEmail($to, $subject, $moja_poruka, $from_address="admin@programeri.com", $from_name="Moke") { $message = " ".$subject." ".$moja_poruka." "; // Da bi poslali HTML email, the Content-type mora biti podesen $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Dodatni headers $headers .= 'To: '.$to.' <'.$to.'>' . "\r\n"; $headers .= 'From: '.$from_name.' <'.$from_address.'>' . "\r\n"; // -- Posalji postu ini_set(sendmail_from,$from_address); // INI configuracija, prisili FROM adresu $mail_sent = mail($to, $subject, $message, $headers); ini_restore(sendmail_from); return $mail_sent; }