Potřebuji radu s nastavením smtp v php.ini když to běží pod windows .
Vím že tam zapíšu moji smtp adresu smtp.xxxx.cz
ale jak tam zadat když je to přes heslo:
jako např smtp od O2: smtp.iol.cz:465 a heslo xxxx.cz ?
Mám tam tohle a nefunguje mi odesílání mailů pomocí fc mail()
SMTP =smtp.iol.cz:465
smtp_port = 25
Jak tam dostat to heslo?
Fórum › PHP
Nastavení smtp v php.ini...pls help

php nevie posielat maili s prihlasenim (meno,heslo) Mozes si stiahnut class phpmailer (vid napr. http://www.php5.sk/?module=Default&action=FAQ#9)
Alebo, ja som to riesil takto:
<?php
// ************************************************************************ //
$tsMail_server = "smtp.server.xx";
$tsMail_port = 25;
$tsMail_user = "meno";
$tsMail_pass = "heslo";
$tsMail_user_enc = "";
$tsMail_pass_enc = "";
// ************************************************************************ //
if ($tsMail_user_enc=="") $tsMail_user_enc = Base64_Encode($tsMail_user);
if ($tsMail_pass_enc=="") $tsMail_pass_enc = Base64_Encode($tsMail_pass);
function tsMail_write($stream, $string, &$log)
{
fwrite($stream, $string);
$log.="<font color=red>$string</font>";
}
function tsMail_read($stream, &$log)
{
$tmp = fread($stream, 255);
$log.= "<font color=blue>$tmp</font>";
return Intval($tmp);
}
function tsMail($from,$to,$subject,$text, &$log)
{
global $tsMail_server; global $tsMail_port; global $tsMail_user_enc; global $tsMail_pass_enc;
$result = false;
$maildata = "";
$maildata.="Date: ".date("r")."\r\n";
$maildata.="From: ". $from."\r\n";
$maildata.="To: ". $to."\r\n";
$maildata.="Subject: ".$subject."\r\n";
$maildata.="\r\n";
$maildata.=$text;
if ($stream=fsockopen($tsMail_server,$tsMail_port))
{
if (tsMail_read($stream,$log)==220)
{
tsMail_write($stream,"HELO localhost\r\n",$log);
if (tsMail_read($stream,$log)==250)
{
tsMail_write($stream,"AUTH LOGIN\r\n",$log);
if (tsMail_read($stream,$log)==334)
{
tsMail_write($stream,$tsMail_user_enc."\r\n",$log);
if (tsMail_read($stream,$log)==334)
{
tsMail_write($stream,$tsMail_pass_enc."\r\n",$log);
if (tsMail_read($stream,$log)==235)
{
tsMail_write($stream,"MAIL FROM: ".$from."\r\n",$log);
if (tsMail_read($stream,$log)==250)
{
tsMail_write($stream,"RCPT TO: ".$to."\r\n",$log);
if (tsMail_read($stream,$log)==250)
{
tsMail_write($stream,"DATA\r\n",$log);
if (tsMail_read($stream,$log)==354)
{
tsMail_write($stream, $maildata."\r\n.\r\n",$log);
if (tsMail_read($stream,$log)==250)
{
tsMail_write($stream,"QUIT\r\n",$log);
$result = true;
} else {
// mail nebol odoslany
}
} else {
// neprijaty prikaz DATA
}
} else {
// nespravny prijemca
}
} else {
// nespravny sender
}
} else {
// nespravny login
}
}
} else {
// nepodporuje auth
}
} else {
// nespravna odpoved na HELO
}
} else {
// smtp server sa nepredstavil
}
fclose($stream);
} else {
// nepodarilo sa pripojit na smtp server
}
$log = Ereg_Replace("\n","<br>",$log);
return $result;
}
// ************************************************************************ //
?>
pouzitie:
tsMail("Janko Hrasko <odosielatel@xxx.yy>","adresat@yyy.xx","vec","text");

Přidej příspěvek
Toto téma je starší jak čtvrt roku – přidej svůj příspěvek jen tehdy, máš-li k tématu opravdu co říct!
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
Aktuálně jsou podporována videa ze serverů YouTube, Vimeo a Dailymotion.
×






























































Uživatelé prohlížející si toto vlákno
Uživatelé on-line: 0 registrovaných, 18 hostů
Podobná vlákna
Jaké nastavení PHP.ini a httpd.conf na localhost — založil Malina
Php.ini .. jak na vypnutí Erroru ?? — založil hybridfusion
Jak používat více php.ini v IIS8 — založil Tr0n
Chyba v nastaveni php ? — založil Radek
PHP - web server - nastaveni cesty k datum — založil Martin
Moderátoři diskuze