Skip to content

Commit

Permalink
Fixed Sending Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewis Goddard committed Dec 7, 2013
1 parent 1b40739 commit df6343a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
22 changes: 12 additions & 10 deletions Browning_Send.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



function Browning_Send($dear, $subject, $message, $regards, $replyto, $Recaptcha){
function Browning_Send($dear, $subject, $message, $regards, $replyto, $Recaptcha=false, $Debug=false){



Expand Down Expand Up @@ -31,18 +31,18 @@ function Browning_Send($dear, $subject, $message, $regards, $replyto, $Recaptcha



$Browning_Dear = htmlspecialchars($dear, ENT_QUOTES, 'UTF-8');
$Browning_Subject = htmlspecialchars($subject, ENT_QUOTES, 'UTF-8');
$Browning_Message = htmlspecialchars($message, ENT_QUOTES, 'UTF-8');
$Browning_Dear = $dear;
$Browning_Subject = $subject;
$Browning_Message = $message;

if(isset($regards)) {
$Browning_Regards = htmlspecialchars($regards, ENT_QUOTES, 'UTF-8');
if(isset($regards) && !empty($regards)) {
$Browning_Regards = $regards;
} else {
$Browning_Regards = $Browning_Global_Regards;
}

if(isset($replyto)) {
$Browning_ReplyTo = htmlspecialchars($replyto, ENT_QUOTES, 'UTF-8');
if(isset($replyto) && !empty($replyto)) {
$Browning_ReplyTo = $replyto;
} else {
$Browning_ReplyTo = $Browning_Global_ReplyTo;
}
Expand Down Expand Up @@ -71,8 +71,10 @@ function Browning_Send($dear, $subject, $message, $regards, $replyto, $Recaptcha
if(curl_errno($Browning_Curl)) return curl_errno($Browning_Curl).' Error: '.curl_error($Browning_Curl);
if(!$Browning_Response) return 'Unable to send email. Check your configuration and keys.';

var_dump($Browning_Response);
var_dump($Browning_Info);
if($Debug) {
var_dump($Browning_Response);
var_dump($Browning_Info);
}

curl_close($Browning_Curl);

Expand Down
9 changes: 1 addition & 8 deletions form.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?php

if(isset($_POST['dear']) || isset($_POST['subject']) || isset($_POST['message']) || isset($_POST['regards']) || isset($_POST['replyto'])) { // Something is jammed
if(isset($_POST['dear']) || isset($_POST['subject']) || isset($_POST['message']) || isset($_POST['regards'])) { // Something is jammed
echo '<div class="warning error">';
if(!isset($_POST['dear'])) echo 'dear';
if(!isset($_POST['subject'])) echo 'subject';
if(!isset($_POST['message'])) echo 'message';
if(!isset($_POST['regards'])) echo 'regards';
if(!isset($_POST['replyto'])) echo 'replyto';
echo '</div>';
}

Expand Down Expand Up @@ -38,12 +37,6 @@
<div class="col span_6_of_12"><input type="text" name="regards" placeholder="Hurricane 3-40U" required /></div>
<div class="col span_3_of_12"><br></div>
</div>
<div class="section group">
<div class="col span_1_of_12"><br></div>
<div class="col span_2_of_12"><label for="replyto"><h3>Reply To</h3></label></div>
<div class="col span_6_of_12"><input type="email" name="replyto" placeholder="[email protected]" required /></div>
<div class="col span_3_of_12"><br></div>
</div>
<div class="section group">
<div class="col span_3_of_12"><br></div>
<div class="col span_6_of_12">
Expand Down
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

require 'Browning_Send.php';
// Make sure you've loaded the script and the config before running this function
Browning_Send($_POST['dear'], $_POST['subject'], $_POST['message'], $_POST['regards'], $_POST['replyto'], true);
$Mail = Browning_Send($_POST['dear'], $_POST['subject'], $_POST['message'], $_POST['regards'], '', true);
// Browning_Send('to email', 'subject', 'message', 'from name', 'reply-to email', recaptcha [boolean: true, false]);
require 'header.php';
echo '<h2>Done!</h2>';
if($Mail===true) echo '<h2>Done!</h2>';
else echo '<h2>'.$Mail.'</h2>';
//require 'done.php';
require 'footer.php';

Expand Down

0 comments on commit df6343a

Please sign in to comment.