I want to call sendEmail($email) function with it's parameters in the href tag when I click on the link I get a page wrote in it FORBIDDEN "you don't have permission to access the root folder on this server"
<?php
require 'PHPMailer-master/PHPMailerAutoload.php';
function sendEmail($email) {
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'zebalaGP@gmail.com'; // SMTP username
$mail->Password = '******'; // SMTP password
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->From = 'zebalaGP@gmail.com';
$mail->FromName = 'ana grin emoticon';
$mail->addAddress($email); // Add a recipient
$mail->isHTML(true);
$mail->Subject = 'blabla !';
$mail->Body = 'Salam,, <br> <b> thanks for your participation grin emoticon you are especial for us grin emoticon ';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if (!$mail->send()) {
echo 'no';
return false;
} else {
echo 'sent grin emoticon';
return true;
}
}
$email='ayaradwan_93@yahoo.com';
//sendEmail($email);
$r=' <a href= ".<?php sendEmail($email); ?>." > Send Email </a> ';
echo $r;
?>