jak powinienem skonfigurowac konto smtp gmaila w tym kodzie?
bo dostaje blad
Warning: fsockopen() [function.fsockopen]: unable to connect to gmail.com:25 (Operation timed out) in /phpmailer/class.smtp.php on line 122
There has been a mail error
SMTP Error: Could not connect to SMTP host.
mail sent
juz pomijajac fakt ze jest mail sent a nie dostaje zadnego maila
kod do przerobienia niedzialajacy..
require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->PluginDir = "phpmailer/";
$mail->From = "[email protected]"; //adres naszego konta
$mail->FromName = "phpMailer tester";//nagłówek From
$mail->Host = "gmail.com";//adres serwera SMTP
$mail->Mailer = "smtp";
$mail->Username = "[email protected]";//nazwa użytkownika
$mail->Password = "MOJEHASLO";//nasze hasło do konta SMTP
$mail->SMTPAuth = true;
$mail->SetLanguage("en", "phpmailer/language/");
$mail->Subject = "Mail testowy";//temat maila
// w zmienną $text_body wpisujemy treść maila
$text_body = "Cześć, chyba phpMailer działa \n\n";
$text_body .= "Na zawsze Twój, \n";
$text_body .= "PHPMailer";
$mail->Body = $text_body;
// adresatów dodajemy poprzez metode 'AddAddress'
$mail->AddAddress("[email protected]","Jurek");
$mail->AddAddress("[email protected]","Franek");
if(!$mail->Send())
echo "There has been a mail error <br>";
echo $mail->ErrorInfo."<br>";
// Clear all addresses and attachments
$mail->ClearAddresses();
$mail->ClearAttachments();
echo "mail sent <br>";