Skip to content

Added newsletter and updated contact form(backend) #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contact-us.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//Load Composer's autoloader
require 'vendor/autoload.php';

$email_id = $_POST['email'] ;
$email_id = $_POST['contactEmail'] ;

$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
Expand All @@ -19,7 +19,7 @@
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'codex.2.0.contact@gmail.com'; // SMTP username
$mail->Password = 'password'; // SMTP password [Password Changed and removed from GitHub for sequrity]
$mail->Password = ''; // SMTP password [Password Changed and removed from GitHub for sequrity]
//$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25; // TCP port to connect to

Expand Down Expand Up @@ -47,4 +47,4 @@
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}


?>
6 changes: 5 additions & 1 deletion css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,11 @@ textarea:focus {
background-color: #3d4145;
}

textarea { min-height: 180px; }
textarea {
min-height: 180px;
white-space: pre-wrap;

}

label,
legend {
Expand Down
65 changes: 57 additions & 8 deletions inc/sendEmail.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

// Replace this with your own email address
$siteOwnersEmail = 'user@website.com';

$siteOwnersEmail = 'codex.2.0.contact@gmail.com';

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

if($_POST) {

Expand All @@ -28,7 +30,7 @@


// Set Message
$message .= "Email from: " . $name . "<br />";
$message = "Email from: " . $name . "<br />";
$message .= "Email address: " . $email . "<br />";
$message .= "Message: <br />";
$message .= $contact_message;
Expand All @@ -44,13 +46,58 @@
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";


if (!$error) {
if (empty($error)) {

ini_set("sendmail_from", $siteOwnersEmail); // for windows server
$mail = mail($siteOwnersEmail, $subject, $message, $headers);

if ($mail) { echo "OK"; }
else { echo "Something went wrong. Please try again."; }
//$mail = mail($siteOwnersEmail, $subject, $message, $headers);

// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function




//Load Composer's autoloader
require '..\vendor\autoload.php';

//$email_id = $_POST['contactEmail'] ;

$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
//$mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'codex.2.0.contact@gmail.com'; // SMTP username
$mail->Password = ''; // SMTP password [Password Changed and removed from GitHub for sequrity]
//$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25; // TCP port to connect to

//Recipients
$mail->setFrom('codex.2.0.contact@gmail.com', 'CODEX_ITER');
$mail->addAddress($email, $name); // Add a recipient
$mail->addAddress('codex.2.0.contact@gmail.com'); // Name is optional
//$mail->addReplyTo('info@example.com', 'Information');
//$mail->addCC('cc@example.com');
//$mail->addBCC('bcc@example.com');

//Attachments
//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name

//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = 'Thanks a ton for sending us a message. We were quite lonely here :D .';

$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}


} # end if - no validation error

Expand All @@ -66,4 +113,6 @@

}



?>
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy