I have installed PHP v5.6.25 (I use the 64x version) and wampserver v3.0.6, Apache 2.4.23.
I have made some port modifications since I have followed several tutorials on YouTube, but I do not remember which lines I have modified on a regular basis.
File php.ini www.dropbox.com/s/vnoxv38qqa67oez/php.ini?dl=0
I am trying to make a mailing system using phpmailer, using as host "smtp.gmail.com" I have enabled access to less secure applications from my gmail account (myaccount.google.com/lesssecureapps).
I was following the following tutorial: "Sending mail by form with PHPMailer" (youtu.be/t4CZa-kHX5E) I downloaded the files included in the description (PHPMailer) and (Program code) but I could not make it work .
My PHP file is as follows:
<?php
require('PHPMailer/PHPMailerAutoload.php');
$oMail = new PHPMailer();
$oMail->isSMTP();
$oMail->Host = 'smtp.gmail.com';
$oMail->Username = '********@gmail.com'; //Confidencial
$oMail->Password = '******************'; //Confidencial;
$oMail->SMTPAuth = true;
$oMail->SMTPSecure = 'ssl';
$oMail->Port = 465; // 587 StartTLS - 465 ssl
$oMail->CharSet = "UTF-8";
/* Envio de mensaje */
$oMail->From = '*******@gmail.com'; //Remitente de GMAIL
$email = filter_var($_POST['email'], FILTER_SANITIZE_EMAIL);
$oMail->addAddress($email); //Destinatario
$oMail->Subject = filter_var($_POST['asunto'], FILTER_SANITIZE_STRING); //asunto
$oMail->Body = filter_var($_POST['mensaje'], FILTER_SANITIZE_STRING); //contenido
/***/
if($oMail->send() == false){
echo "No se pudo enviar email";
echo $oMail->ErrorInfo;
} else {
echo "Mensaje enviado";
}?>
If using the Gmail host service 'smtp.gmail.com' with security type ssl, according to this www.arclab.com/en/kb/email/how-to-enable-imap-pop3-smtp -gmail-account.html should use port 465 ... in this case should I make any changes to my php.ini file?