yetonalpa Posted August 10, 2010 Share Posted August 10, 2010 hi everyone I have this site i want to make changes to the contact form. Right now it sends the info to a database and posts in the admin area. I have this file controller.php that has a section with a funtion function Cuenta_Contactos that i think passes the info. Is there a way to add an email address there so it sends the message to that email account? Thanks ive attached the file . [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/210275-php-controller/ Share on other sites More sharing options...
gizmola Posted August 10, 2010 Share Posted August 10, 2010 Not even close. function Cuenta_Contactos(){ $datos = $this->objDBA->cuentaCampos('tbl_contacto','Order By Fecha DESC'); return $datos[0]['Cuenta']; } That just does a query from the the tbl_contacto and returns the results in an array. There are several functions that use phpMailer, and these could be easily cloned to mail something to you from a contact form. For example: function Envia_Mail_Activacion_Empleado($path, $datos){ $opcion = 0; //$regexmail = "/^[A-Za-z]*[0-9]*[A-Za-z]+@[A-Za-z]*[0-9]*[A-Za-z]+(\.[A-Za-z]{2,4})$/"; //if(isset($_POST['Nombre']) && isset($_POST['Comentario']) && isset($_POST['Email']) && $this->Revisa_Campo_Busqueda($_POST['Nombre']) == true && $this->Revisa_Campo_Busqueda($_POST['Comentario']) == true && preg_match($regexmail, $_POST['Email'])){ echo $opcion = 1; include($path.'../Model/Mailer/PHPMailer.php'); $mailer = new PHPMailer(); $mailer->From = '[email protected]'; //$mailer->FromName = $_POST['Nombre']; $mailer->FromName = 'Ideas del Mar'; //$mailer->Subject = $datos[0]['Nombre'].' Rentas DePlaya'; $mailer->Subject = 'Activar cuenta Ventas'; $texto = '</pre> <table width="200" border="0" align="center" cellpadding="3" cellspacing="3"> Bienvenido a la sección de Ventas donde podras ver el estatus los clienes así como sus respectivas vallas e información Su nombre de Usuario: '.$datos[0]['username'].' Para continuar su registro es neceseario activar su cuenta en la siguiente LINK http://www.ideasdelmar.com/ventas/activar.php?ActiveNumber='.$datos[0]['ActiveN'].'&action= Si el LINK no funciona copia y pega la dirección en tu navegador Para accesar a la sección hay que entrar a la siguiente URL www.ideasdelmar.com/ventas/ Atte IDEAS DEL MAR www.ideasdelmar.com Este mensaje se dirige exclusivamente a su destinatario. Contiene información considerada como CONFIDENCIAL, sometida a secreto profesional o cuya divulgación está prohibida por la ley. Si ha recibido este mensaje por error, debe saber que su copia y uso están prohibidos. Le rogamos que nos lo comunique inmediatamente por esta misma vía o por teléfono y proceda a su destrucción. </table>';<br> $mailer->Body = $texto;<br> //$mailer->Body = $_POST['email'].' >>>>> dejo el siguiente pregunta: '.$_POST['Comentario']. ' >>>>>> de la Propiedad >>>> '.$datos[0]['username'].' >>>> http://www.deplaya.com.mx/rentas/propiedad.php?id='.$datos[0]['Id'].'&por='.$promotors[0]['IdPromotor'];<br> $mailer->AddAddress($datos[0]['email'], $datos[0]['username']);<br> $mailer->Send();<br> $mailer->ClearAddresses();<br> //}<br> return $opcion;<br Link to comment https://forums.phpfreaks.com/topic/210275-php-controller/#findComment-1097288 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.