Added the files

This commit is contained in:
2017-02-13 18:08:43 +01:00
parent acedf6bae9
commit f3f19af0ac
87 changed files with 36756 additions and 0 deletions

49
inc/PHPMailerAutoload.php Executable file
View File

@ -0,0 +1,49 @@
<?php
/**
* PHPMailer SPL autoloader.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailer SPL autoloader.
* @param string $classname The name of the class to load
*/
function PHPMailerAutoload($classname)
{
//Can't use __DIR__ as it's only in PHP 5.3+
$filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php';
if (is_readable($filename)) {
require $filename;
}
}
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
//SPL autoloading was introduced in PHP 5.1.2
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register('PHPMailerAutoload', true, true);
} else {
spl_autoload_register('PHPMailerAutoload');
}
} else {
/**
* Fall back to traditional autoload for old PHP versions
* @param string $classname The name of the class to load
*/
function __autoload($classname)
{
PHPMailerAutoload($classname);
}
}

3893
inc/class.phpmailer.php Executable file

File diff suppressed because it is too large Load Diff

1181
inc/class.smtp.php Executable file

File diff suppressed because it is too large Load Diff

80
inc/sendEmail.php Executable file
View File

@ -0,0 +1,80 @@
<?php
require 'PHPMailerAutoload.php';
if($_POST) {
$captcha = '';
$error = array();
$name = trim(stripslashes($_POST['contactName']));
$email = trim(stripslashes($_POST['contactEmail']));
$subject = trim(stripslashes($_POST['contactSubject']));
$contact_message = trim(stripslashes($_POST['contactMessage']));
if(isset($_POST['contactCaptcha'])){
$captcha = $_POST['contactCaptcha'];
}
// Check Name
if (strlen($name) < 2) {
$error['name'] = "Please enter your name.";
}
// Check Email
if (!preg_match('/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is', $email)) {
$error['email'] = "Please enter a valid email address.";
}
// Check Message
if (strlen($contact_message) < 10) {
$error['message'] = "Please enter your message. It should have at least 10 characters.";
}
// Captcha
if (!$captcha){
$error['captcha'] = "Please check the CAPTCHA field.";
} else {
$captchaResponse = json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6Le1wRcTAAAAADbdnvPLKQ_hupTI4jzaGGXFQhQA&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']), true);
if($captchaResponse['success'] == false) {
$error['captcha'] = "You are a robot.";
}
}
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.zoho.com;'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'contact@delkappa.com'; // SMTP username
$mail->Password = '%em33447'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
$mail->setFrom('contact@delkappa.com', $name);
$mail->addAddress('manos@delkappa.com', 'Manos Katsomallos'); // Add a recipient
$mail->addReplyTo($email, $name);
$mail->Subject = $subject;
$mail->Body = $contact_message;
if (!$error) {
if (!$mail->send()) {
echo "Something went wrong. Please try again.";
} else {
echo "OK";
}
} # end if - no validation error
else {
$response = (isset($error['name'])) ? $error['name'] . "<br /> \n" : null;
$response .= (isset($error['email'])) ? $error['email'] . "<br /> \n" : null;
$response .= (isset($error['message'])) ? $error['message'] . "<br />" : null;
$response .= (isset($error['captcha'])) ? $error['captcha'] . "<br />" : null;
echo $response;
} # end if - there was a validation error
}
?>