Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/07/2016, 13:16
Avatar de Patriarka
Patriarka
 
Fecha de Ingreso: enero-2011
Ubicación: Moreno, Buenos Aires, Argentina
Mensajes: 2.851
Antigüedad: 13 años, 3 meses
Puntos: 288
Respuesta: problemas con stmp

la mejor forma es PHPMailer como dicen los amigos pero para que funcione bien la funcion mail hay que confirgurar muchas cosas mas.
por ejemplo en el php.ini encontras algo así:

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = you@yourdomain


aca podes configurar tus datos de smtp , no hace falta poner las contraseñas
te doy el que yo uso, pero adaptalo a tu script:

Código PHP:
Ver original
  1. // Para enviar correo HTML, la cabecera Content-type debe definirse
  2.             $headers  = 'To: '.$this->getFullRecipient() . $eol;
  3.             $headers .= 'From: "'.$this->getSenderName().'" <'.$this->getSenderEmail().'> ' . $eol ;
  4. //          $headers .= 'Reply-To: '.$this->getSenderEmail() . $eol;
  5.             if($this->replyTo != ""){
  6.                 $headers .= 'Reply-To: ' . $this->replyTo . $eol;
  7.             }else{
  8.                 $headers .= 'Reply-To: '.$this->senderEmail. $eol;
  9.             }
  10.             $headers .= 'Bcc: '.$this->getBccEmail() . $eol;
  11.             $headers .= 'X-Mailer: PHP/' . phpversion(). $eol;
  12.             $headers .= 'MIME-Version: 1.0' . $eol;
  13.             //$headers .= 'MIME-Version: 1.0' . $eol;
  14.  
  15.             if($this->fileAttached){
  16.                 $headers .= 'Content-Type: multipart/mixed; boundary="'.$this->mime_boundary.'"'.$eol;
  17.             }else{
  18.                 $headers .= 'Content-type: text/html; charset=iso-8859-1'.$eol;
  19.             }
  20.  
  21.             $mail_result = mail ($this->getRecipientEmail(), $this->subject,
  22.                     $this->body, $headers,
  23.                     "-f$this->senderEmail -F".
  24.                     $this->encode($this->recipientName,'ISO-8859-1'));