Lid |
|
Beste, mijn host heeft de mail() functie uitgeschakeld. Nu wou ik PHPmailer gebruiken maar dat werkt dus ook al niet meer, ik krijg de foutmelding:
Could not instantiate mail function.
Nu wou ik SMTP gebruiken maar ook dat lukt niet, ik heb die van Google ingevuld maar ik krijg de foutmelding:
SERVER -> CLIENT:
SMTP NOTICE: EOF caught while checking if connected
SMTP Error: Could not authenticate.
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingSERVER -> CLIENT:
SMTP NOTICE: EOF caught while checking if connected
SMTP Error: Could not authenticate.
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
SERVER -> CLIENT: SMTP NOTICE: EOF caught while checking if connected SMTP Error: Could not authenticate. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingSERVER -> CLIENT: SMTP NOTICE: EOF caught while checking if connected SMTP Error: Could not authenticate. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
iemand enig idee hoe ik nu nog email kan versturen? ik host bij www.pcextreme.nl
Kan zijn dat mijn code verkeerd is hoor, onderstaand de code die ik gebruik:
require_once('includes/class.phpmailer.php');
require_once('includes/class.smtp.php');
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = "smtp.gmail.com";
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 465;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication
$mail->Username = "******@gmail.com";
//Password to use for SMTP authentication
$mail->Password = "******";
//Set who the message is to be sent from
$mail->setFrom('from@example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto@example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML('test');
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
require_once('includes/class.phpmailer.php'); require_once('includes/class.smtp.php'); //Create a new PHPMailer instance $mail = new PHPMailer; //Tell PHPMailer to use SMTP $mail->isSMTP(); //Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages $mail->SMTPDebug = 2; //Ask for HTML-friendly debug output $mail->Debugoutput = 'html'; //Set the hostname of the mail server $mail->Host = "smtp.gmail.com"; //Set the SMTP port number - likely to be 25, 465 or 587 $mail->Port = 465; //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication $mail->Username = "******@gmail.com"; //Password to use for SMTP authentication $mail->Password = "******"; //Set who the message is to be sent from $mail->setFrom('from@example.com', 'First Last'); //Set an alternative reply-to address $mail->addReplyTo('replyto@example.com', 'First Last'); //Set who the message is to be sent to $mail->addAddress('whoto@example.com', 'John Doe'); //Set the subject line $mail->Subject = 'PHPMailer SMTP test'; //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $mail->msgHTML('test'); //Replace the plain text body with one created manually $mail->AltBody = 'This is a plain-text message body';
Hoop dat iemand mij uit de brand kan helpen.
Groetjes
|