Update analytics.php
[clinton/MarylandElectronicPetitionSignature.git] / email.php
index 49ab5bd..8dd59b1 100644 (file)
--- a/email.php
+++ b/email.php
@@ -3,12 +3,13 @@
 require_once "Mail.php";
 include_once('/var/www/secure.php');
 
+// USAGE meps_mail('Patrick <baltimorehacker@gmail.com>','I just wanted to take a second and follow up with your visit to md-petition.com and see if you needed anything, or had any questions.','Petition Follow-Up');
 function meps_mail($to,$msg,$sub){
     global $gmail_email_user;
     global $gmail_email_pass;
     $from = 'MD Petition Support <mdpetition@gmail.com>';
     //$to = 'Patrick <baltimorehacker@gmail.com>';
-    $subject = $sub.' [MD-Petiton.com]';
+    $subject = $sub.' [MD-Petition.com]';
     $body = "$msg <br><br><br><br> Patrick McGuire <br>MD Petition Support  mdpetition@gmail.com <br> https://www.md-petition.com ";
 
     $headers = array(
@@ -30,11 +31,10 @@ function meps_mail($to,$msg,$sub){
     $mail = $smtp->send($to, $headers, $body);
 
     if (PEAR::isError($mail)) {
-       // echo('<p>' . $mail->getMessage() . '</p>');
+       return $mail->getMessage();
     } else {
-       // echo('<p>Message successfully sent!</p>');
+       return 'NO ERROR';
     }
+    
 }
 
-
- meps_mail('Patrick <baltimorehacker@gmail.com>','I just wanted to take a second and follow up with your visit to md-petition.com and see if you needed anything, or had any questions.','Petition Follow-Up');