Witam!
Oto mój formularz
<form method="post" name="kontakt" action="send_mail.php"> <div><input type="text" name="txtName" title="Imię i nazwisko" id="txtName" class="text"></div> <div><input type="text" name="txtEmail" title="Email" id="txtEmail" class="text"></div> <div><input type="text" name="txtTitle" title="Tytuł" id="txtTitle" class="text"></div> <div><textarea cols="30" rows="10" name="txtMessage" id="txtMessage" class="text" title="Treść wiadomości"></textarea></div> <input type="submit" value="Wyślij">
A tutaj plik send_mail.php
<?php
require_once('phpmailer/class.phpmailer.php');
$mail = new PHPMailer(true);
$mail->PluginDir = "phpmailer/";
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "xxx@gmail.com";
$mail->Password = "xxxxx";
$mail->SetFrom('xxx@gmail.com', 'Nasze imie i nazwisko');
$mail->AddAddress("email@adresata.pl"); // ADRESAT
$mail->Subject = 'To jest wiadomość testowa. Sprawdzam czcionki!';
// 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;
if(!$mail->Send())
echo "There has been a mail error <br>"; echo $mail->ErrorInfo."<br>";
// Clear all addresses and attachments
$mail->ClearAddresses();
$mail->ClearAttachments();
?>
Jak widać, jeszcze nic z formularza nie jest pobierane, wszystko jest wpisane na sztywno. Login i hasło są na pewno poprawne. Niestety, po naciśnięciu przycisku wysyłającego formularz pojawia się na pasku url localhost/send_mail.php i pusta strona, ani komunikat o błędzie ani nic. Mail oczywiście nie dochodzi. Ma ktoś może pomysł, jaka może być przyczyna?
Serdecznie pozdrawiam,
Dagna
Ten post edytował Cadi2108 15.06.2012, 09:35:31