vishwamano

source of vishwamano.com
git clone git://git.ricketyspace.net/vishwamano.git
Log | Files | Refs

commit 1d03ae749d610bf20fa6975bcc0d4872c5e7b77b
parent 58d3ba411cb1391630e5187f3e5c537ec0103952
Author: rsiddharth <rsiddharth@ninthfloor.org>
Date:   Sun,  5 Apr 2015 12:30:25 -0400

utils.php: modded send_message - checks if mail was really sent.

Diffstat:
utils.php | 19++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/utils.php b/utils.php @@ -162,12 +162,21 @@ function send_message($email) { $headers = "From: no-reply@vishwamano.com\n"; $headers .= "Reply-To: $email_address"; - mail($to,$email_subject,$email_body,$headers); - - $alert_msg = 'Your message has been sent to <strong>Vishwa Manoharan</strong>.'; - $alert = array( 'type' => 'success', + $sent = mail($to,$email_subject,$email_body,$headers); + + print_r($sent); + + if($sent == FALSE) { + $alert_msg = '<strong> Error: Message not sent</strong>. Please try again.' + . ' If problem persists email <strong>Vishwa Manoharan' + . ' &lt;vishwa91photography@gmail.com&gt;.</strong>'; + $alert = array( 'type' => 'danger', + 'content' => $alert_msg); + }else { + $alert_msg = 'Your message has been sent to <strong>Vishwa Manoharan</strong>.'; + $alert = array( 'type' => 'success', 'content' => $alert_msg); - + } } else {