Fatal error: Uncaught Error: Class 'PHPMailer' not found in /home/admin/domains/domain.nl/private_html/inc/aanmelden_business.php:144 Stack trace: #0 /home/admin/domains/domain.nl/private_html/inc/webshop_registratie.php(11): include() #1 /home/admin/domains/domain.nl/private_html/index.php(101): include('/home/admin/dom...') #2 {main} thrown in /home/admin/domains/domain.nl/private_html/inc/aanmelden_business.php on line 144
met deze includes
require (DOC_ROOT.'inc/PHPMailer/src/PHPMailer.php');
require (DOC_ROOT.'inc/PHPMailer/src/Exception.php');
require (DOC_ROOT.'inc/PHPMailer/src/SMTP.php');
Dan...
$mail = new PHPMailer(); // defaults to using php "mail()"
.. hier gaat het fout.
De paden zijn correct en snap niet waarom het niet duidelijk staat beschreven in de manual.
Ik kom dus niet verder hiermee. Ik wil eigenlijk gewoon een pdf als attachment mailen.
[size=xsmall]Toevoeging op 12/05/2019 07:33:04:[/size]
UPDATE
$mail = new PHPMailer\PHPMailer\PHPMailer(); // defaults to using php "mail()"
//$body = file_get_contents($bericht);
//$body = preg_match("[\]",'',$body);
$mail->AddReplyTo("[email protected]","First Last");
$mail->SetFrom('[email protected]');
$mail->AddReplyTo("[email protected]","First Last");
$address = "[email protected]";
$mail->AddAddress($address, "John Doe");
$mail->Subject = "PHPMailer Test Subject via mail(), basic";
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->IsHTML(true);
$mail->Body = $bericht;
//$mail->MsgHTML($body);
$mail->AddAttachment(DOC_ROOT."bedrijf_docs/algemene_voorwaarden-test.docx"); // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
message is nu send, maar komt niet aan zonder foutmeldingen.