Contacto
require('../lib/recaptcha.php'); define('PRODUCCION', $_SERVER['HTTP_HOST'] === 'idaim.org.mx'); $publickey = "6Lehw_ESAAAAABVm6gsdguxyfe-ndzfMyc-wHzFY"; $privatekey = "6Lehw_ESAAAAAAMaBg1rq2-6IDGH19SXPTh3TZ63"; $fields = array('nombre', 'email', 'mensaje'); function valid_captcha(){ if (!PRODUCCION) { return true; } global $privatekey; $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); return $resp->is_valid; } if ($_POST['nombre'] && valid_captcha()): require('../lib/aws.phar'); $data = (object) array_combine($fields, array_map(function($f){ return htmlentities(trim($_POST[$f])); }, $fields)); $client = Aws\Ses\SesClient::factory(array( 'key' => 'AKIAJG64LWCC2P72JSQQ', 'secret' => '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', 'region' => 'us-east-1' )); $msg = <<{$data->mensaje}idaim.org.mx EMAIL; $dst = PRODUCCION ? 'renata@fundar.org.mx' : 'rob@surrealista.mx'; $email = array( 'Source' => 'no-reply@idaim.org.mx', 'Destination' => array('ToAddresses' => array($dst)), 'Message' => array( 'Subject' => array( 'Data' => 'Contacto de fundar.org.mx', 'Charset' => 'utf-8' ), 'Body' => array( 'Text' => array( 'Data' => str_replace('
', "\r\n", $msg), 'Charset' => 'utf-8' ), 'Html' => array( 'Data' => $msg, 'Charset' => 'utf-8' ) ) ), 'ReplyToAddresses' => array($data->email), //'ReturnPath' => $dst ); try { $result = $client->sendEmail($email); } catch (\Exception $e) { if (PRODUCCION) { echo ""; } } ?>
¡Gracias por tu comentario!
Escríbenos si deseas recibir mayor información.