Witam wszystkich,
mam taki problem: Mam klasę weryfikującą dane z formularza i w tej klasie mam metodę, która ma wysłać emaila (używając phpmailer) potwierdzającego. Niestety z niewiadomego mi powodu ta metoda nie chce działać.
require_once 'phpmailer/class.phpmailer.php';
class Veryfication extends PHPMailer {
function validForm() {
if(sizeof($this->errors) > 0
) { return $this->errors;
} else {
$this->sendEmail();
return $this->tableofdata;
}
}
function sendEmail() {
$mail = new PHPMailer();
$mail->PluginDir = "phpmailer/";
$mail->From = "emailweryfikacyjny@poczta.pl"; //adres naszego konta
$mail->FromName = "weryfikacja konta";//nagłówek From
$mail->Host = "smtp.poczta.pl";//adres serwera SMTP
$mail->Mailer = "smtp";
$mail->Username = "emailweryfikacyjny@poczta.pl";//nazwa użytkownika
$mail->Password = "haslo";//nasze hasło do konta SMTP
$mail->SMTPAuth = true;
$mail->SMTPDebug = 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("kolega@gmail.com","Kolega");
if($mail->Send()) {
return true;
}
// Clear all addresses and attachments
$mail->ClearAddresses();
$mail->ClearAttachments();
}
}
Dostaję takie błędy
Warning
: require_once(phpmailer
/class.smtp
.php
): failed to open stream
: No such
file or directory in
/home
/user
/webmaster
/htdocs
/projekt
/php
/phpmailer
/class.phpmailer
.php on line 702 Fatal error
: require_once(): Failed opening required
'phpmailer/class.smtp.php' (include_path
='.:/usr/share/php:/usr/share/pear') in
/home
/user
//webmaster/htdocs/projekt/php/phpmailer/class.phpmailer.php on line 702
Pliki, które są wymienione wyżej są w tych katalogach.
Ten post edytował user_php.pl 8.10.2010, 15:29:41