$random_hash = md5(date('r', time()));
$message=<<<EOL
--frontier
Content-type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Poštovanje,
uspešno ste kreirali novi nalog na aplikaciji
Vaše korisni�ko ime: $username
Ã…Â ifra: $p_sifra
Molimo vas da sa�uvate ove podatke, kako bi ih ubudu�e bez problema koristili.
Pristup aplikaciji je mogu� putem:
$http_path
--frontier
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<h2>Poštovanje, </h2>
<p>
uspešno ste kreirali novi nalog na aplikaciji
</p>
Vaše korisni�ko ime: $username<br/>
Ã…Â ifra: $p_sifra<br/><br/>
Molimo vas da sa�uvate ove podatke, kako bi ih ubudu�e bez problema koristili.<br/>
<br/>
Pristup aplikaciji je mogu� putem:<br/>
$http_path
</body>
</html>
--frontier--
EOL;
print $message;
$fd = popen("sendmail -t","w") or die("Couldn't Open Sendmail");
fputs($fd, "To: aleksandar@blabla.com \n");
fputs($fd, "From: \"Your App\" <aleksandar@blabla.com> \n");
fputs($fd, "Subject: Test message from my web site \n");
fputs($fd,"MIME-Version: 1.0\n");
fputs($fd,"Content-type: multipart/alternative; boundary=\"frontier\"\n\n");
fputs($fd,"This is a message with multiple parts in MIME format.\n");
fputs($fd, $message);
pclose($fd);