Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/10/2008, 11:53
Avatar de gabyfornia
gabyfornia
 
Fecha de Ingreso: diciembre-2004
Ubicación: USA
Mensajes: 182
Antigüedad: 19 años, 4 meses
Puntos: 0
Exclamación Problema con Envio de mail

Hola amigos, ya habia puesto un post con un tema parecido. El tema es que cuando, probando el famoso "forgot your password" en un formulario de login, al incluir el email para el envio supuesto del password, me sale un mensaje asi:


Developer Details: E-mail couldn't be sent. Error returned: mail() returned failure

Warning: mail(): SMTP server response: 553 Sorry, that domain isn't in my list of allowed rcpthosts. in c:\appserv\www\uniendolatinos2009\includes\common\ lib\email\Pear\Mail\mail.php on line 115
. (EMAIL_FAILED)

Ahora bien, el tema es que si bien ya configure el php.ini con mi server del correo, igual me sale todo mal y quiero incluir la funcion ini_set en el siguiente codigo de php, probe de algunas formas pero no tuve exito, donde deberia ir inserto este codigo?: ini_set(sendmail_from,'[email protected]');


Código php:
Ver original
  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // | PHP Version 4                                                        |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 1997-2003 The PHP Group                                |
  7. // +----------------------------------------------------------------------+
  8. // | This source file is subject to version 2.02 of the PHP license,      |
  9. // | that is bundled with this package in the file LICENSE, and is        |
  10. // | available at through the world-wide-web at                           |
  11. // | [URL]http://www.php.net/license/2_02.txt[/URL].                                 |
  12. // | If you did not receive a copy of the PHP license and are unable to   |
  13. // | obtain it through the world-wide-web, please send a note to          |
  14. // | [EMAIL="[email protected]"][email protected][/EMAIL] so we can mail you a copy immediately.               |
  15. // +----------------------------------------------------------------------+
  16. // | Author: Chuck Hagenbuch <[EMAIL="[email protected]"][email protected][/EMAIL]>                            |
  17. // +----------------------------------------------------------------------+
  18. //
  19. // $Id: mail.php,v 1.14 2005/08/09 04:54:37 jon Exp $
  20. /**
  21.  * internal PHP-mail() implementation of the PEAR Mail:: interface.
  22.  * @package Mail
  23.  * @version $Revision: 1.14 $
  24.  */
  25. class Mail_mail extends Mail {
  26.     /**
  27.      * Any arguments to pass to the mail() function.
  28.      * @var string
  29.      */
  30.     var $_params = '';
  31.     /**
  32.      * Constructor.
  33.      *
  34.      * Instantiates a new Mail_mail:: object based on the parameters
  35.      * passed in.
  36.      *
  37.      * @param array $params Extra arguments for the mail() function.
  38.      */
  39.     function Mail_mail($params = null)
  40.     {
  41.         /* The other mail implementations accept parameters as arrays.
  42.          * In the interest of being consistent, explode an array into
  43.          * a string of parameter arguments. */
  44.         if (is_array($params)) {
  45.             $this->_params = join(' ', $params);
  46.         } else {
  47.             $this->_params = $params;
  48.         }
  49.         /* Because the mail() function may pass headers as command
  50.          * line arguments, we can't guarantee the use of the standard
  51.          * "\r\n" separator.  Instead, we use the system's native line
  52.          * separator. */
  53.         $this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
  54.     }
  55.  /**
  56.      * Implements Mail_mail::send() function using php's built-in mail()
  57.      * command.
  58.      *
  59.      * @param mixed $recipients Either a comma-seperated list of recipients
  60.      *              (RFC822 compliant), or an array of recipients,
  61.      *              each RFC822 valid. This may contain recipients not
  62.      *              specified in the headers, for Bcc:, resending
  63.      *              messages, etc.
  64.      *
  65.      * @param array $headers The array of headers to send with the mail, in an
  66.      *              associative array, where the array key is the
  67.      *              header name (ie, 'Subject'), and the array value
  68.      *              is the header value (ie, 'test'). The header
  69.      *              produced from those values would be 'Subject:
  70.      *              test'.
  71.      *
  72.      * @param string $body The full text of the message body, including any
  73.      *               Mime parts, etc.
  74.      *
  75.      * @return mixed Returns true on success, or a PEAR_Error
  76.      *               containing a descriptive error message on
  77.      *               failure.
  78.      *
  79.      * @access public
  80.      */
  81.     function send($recipients, $headers, $body)
  82.     {
  83.         // If we're passed an array of recipients, implode it.
  84.         if (is_array($recipients)) {
  85.             $recipients = implode(', ', $recipients);
  86.         }
  87.         // Get the Subject out of the headers array so that we can
  88.         // pass it as a seperate argument to mail().
  89.         $subject = '';
  90.         if (isset($headers['Subject'])) {
  91.             $subject = $headers['Subject'];
  92.             unset($headers['Subject']);
  93.         }
  94.         // Flatten the headers out.
  95.         $headerElements = $this->prepareHeaders($headers);
  96.         if (PEAR::isError($headerElements)) {
  97.             return $headerElements;
  98.         }
  99.         list(, $text_headers) = $headerElements;
  100.         /*
  101.          * We only use mail()'s optional fifth parameter if the additional
  102.          * parameters have been provided and we're not running in safe mode.
  103.          */
  104.         $warnings = '';
  105.         ob_start();
  106.         if (empty($this->_params) || ini_get('safe_mode')) {
  107.             $result = mail($recipients, $subject, $body, $text_headers);
  108.         } else {
  109.             $result = mail($recipients, $subject, $body, $text_headers,
  110.                            $this->_params);
  111.         }
  112.         $warnings = ob_get_contents();
  113.         ob_end_clean();
  114.         /*
  115.          * If the mail() function returned failure, we need to create a
  116.          * PEAR_Error object and return it instead of the boolean result.
  117.          */
  118.         if ($result === false) {
  119.             $result = PEAR::raiseError('mail() returned failure<br />'.$warnings);
  120.         }
  121.         return $result;
  122.     }
  123. }
  124. ?>
__________________
:stress: De las Aves que Vuelan me gusta el Chancho!!:si:

Última edición por GatorV; 08/10/2008 a las 12:42 Razón: tags PHP