Forma de correo SMTP con PEAR y WAMPServer?
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
honestamente, he estado trabajando en esto durante varios días y han llegado a ninguna parte. No tengo idea de qué escribir código, ni idea de cómo llegar a enviar, ni idea de donde me fui de mi cerebro cuando se filtró fuera de mi cabeza.
Id puesto algo de código para los chicos a mirar, pero no tengo, como he dicho, nada de esto funciona, ni es siquiera cerca.
Necesito el formulario en este sitio: http://173.11.86.101/voltec/ para enviar a un archivo php que trabaja con peras correo complemento.
Ive estudió alrededor de 20 sitios diferentes, leer los tutoriales bandido aquí, así como 10 - 15 tuts en otros lugares. Cualquier ayuda muchachos?
Id puesto algo de código para los chicos a mirar, pero no tengo, como he dicho, nada de esto funciona, ni es siquiera cerca.
Necesito el formulario en este sitio: http://173.11.86.101/voltec/ para enviar a un archivo php que trabaja con peras correo complemento.
Ive estudió alrededor de 20 sitios diferentes, leer los tutoriales bandido aquí, así como 10 - 15 tuts en otros lugares. Cualquier ayuda muchachos?
Use your words like arrows to shoot toward your goal.
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Junio 24th, 2009, 9:44 pm
- Bogey
- Bogey


- Registrado: Jul 14, 2005
- Mensajes: 8211
- Loc: USA
- Status: Offline
Muéstrame el complemento de correo PEAR...usted también puede explicar el problema un poco más? Qué es exactamente lo que estás tratando de hacer...las cosas que quiere en la forma que le envíen por correo electrónico?
Puedo enviarle el SMTP de la clase que tengo y modificado un poco...funciona perfectamente. (La uso para enviar la verificación de la cuenta, póngase en contacto conmigo, o de usuario a usuario de correo electrónico y envío de correo electrónico a mis otras necesidades).
Parece que las peras de correo complemento que falta al menos una dependencia. (Mail.php pedido en sendemail.php).
Puedo enviarle el SMTP de la clase que tengo y modificado un poco...funciona perfectamente. (La uso para enviar la verificación de la cuenta, póngase en contacto conmigo, o de usuario a usuario de correo electrónico y envío de correo electrónico a mis otras necesidades).
Parece que las peras de correo complemento que falta al menos una dependencia. (Mail.php pedido en sendemail.php).
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
Creo esto es la pera thats paquete instalado
php 5, la más reciente versión estable.
sí, quiero que los datos del formulario que se enviará a un correo electrónico a través de un servidor SMTP cuando el usuario golpea presentar.
php 5, la más reciente versión estable.
sí, quiero que los datos del formulario que se enviará a un correo electrónico a través de un servidor SMTP cuando el usuario golpea presentar.
Use your words like arrows to shoot toward your goal.
- Bogey
- Bogey


- Registrado: Jul 14, 2005
- Mensajes: 8211
- Loc: USA
- Status: Offline
La clase SMTP que yo uso es...
El smtpServer $ es el servidor SMTP que está utilizando. GMAIL hace esto, o usted puede usar el suyo si usted tiene uno.
El $ port es el número de puerto del servidor SMTP.
El $ usuario es el nombre de usuario utilizado para iniciar sesión en el servidor SMTP.
El $ password es la contraseña utilizada con el nombre de usuario para poder conectarse al servidor SMTP.
El $ username_email es su correo electrónico principal, donde el correo se enviará a.
El localdomain $ es su dominio.
Y para usarlo con su información...
Espero que tuviera sentido. Y espero que ayuda a gif "alt =": D "title =" muy feliz ">
Acerca de lo de PEAR. Asegúrese de que Mail.php está en el directorio correcto y que el código se incluye la dirección correcta para Mail.php
Código: [ Select ]
<?php
// Mail.php
class mail
{
private $smtpServer = 'smtp.site.com';
private $port = '25';
private $timeout = 30;
private $username = 'smtp_user';
private $password = 'smtp_pass';
private $username_email = 'admin@site.com';
private $newline = "\r\n";
private $localdomain = 'site.com';
private $charset = 'windows-1251';
private $contentTransferEncoding = false;
// Do not change anything below
private $smtpConnect = false;
private $to = false;
private $subject = false;
private $message = false;
private $headers = false;
private $logArray = array(); // Array response message for debug
private $Error = '';
public function __construct($to, $subject, $message, $to2 = false) {
$this->to = (($to2 !== false)? $this->username_email : $to);
$this->subject = &$subject;
$this->message = &$message;
// Connect to server
if(!$this->Connect2Server()) {
// Display error message
echo '<pre>'.trim($this->Error).'</pre>'.$this->newline.'<!-- '.$this->newline;
print_r($this->logArray);
echo $this->newline.'-->'.$this->newline;
return false;
}
return true;
}
private function Connect2Server() {
$from = (($to2 == false)? $this->username_email : $to);
// Connect to server
$this->smtpConnect = fsockopen($this->smtpServer,$this->port,$errno,$error,$this->timeout);
$this->logArray['CONNECT_RESPONSE'] = $this->readResponse();
if (!is_resource($this->smtpConnect)) {
return false;
}
$this->logArray['connection'] = "Connection accepted: {$smtpResponse}";
// Hi, server!
$this->sendCommand("HELO {$this->localdomain}");
$this->logArray['HELO'] = $this->readResponse();
// Let's know each other
$this->sendCommand('AUTH LOGIN');
$this->logArray['AUTH_REQUEST'] = $this->readResponse();
// My name...
$this->sendCommand(base64_encode($this->username));
$this->logArray['REQUEST_USER'] = $this->readResponse();
// My password..
$this->sendCommand(base64_encode($this->password));
$this->logArray['REQUEST_PASSWD'] = $this->readResponse();
// If error in response auth...
if (substr($this->logArray['REQUEST_PASSWD'],0,3)!='235') {
$this->Error .= 'Authorization error! '.$this->logArray['REQUEST_PASSWD'].$this->newline;
return false;
}
// "From" mail...
$this->sendCommand("MAIL FROM: {$from}");
$this->logArray['MAIL_FROM_RESPONSE'] = $this->readResponse();
if (substr($this->logArray['MAIL_FROM_RESPONSE'],0,3)!='250') {
$this->Error .= 'Mistake in sender\'s address! '.$this->logArray['MAIL_FROM_RESPONSE'].$this->newline;
return false;
}
// "To" address
$this->sendCommand("RCPT TO: {$this->to}");
$this->logArray['RCPT_TO_RESPONCE'] = $this->readResponse();
if(substr($this->logArray['RCPT_TO_RESPONCE'],0,3) != '250')
{
$this->Error .= 'Mistake in reciepent address! '.$this->logArray['RCPT_TO_RESPONCE'].$this->newline;
}
// Send data to server
$this->sendCommand('DATA');
$this->logArray['DATA_RESPONSE'] = $this->readResponse();
// Send mail message
if (!$this->sendMail()) return false;
// Good bye server! =)
$this->sendCommand('QUIT');
$this->logArray['QUIT_RESPONSE'] = $this->readResponse();
// Close smtp connect
fclose($this->smtpConnect);
return true;
}
// Function send mail
private function sendMail() {
$this->sendHeaders();
$this->sendCommand($this->message);
$this->sendCommand('.');
$this->logArray['SEND_DATA_RESPONSE'] = $this->readResponse();
if(substr($this->logArray['SEND_DATA_RESPONSE'],0,3)!='250') {
$this->Error .= 'Mistake in sending data! '.$this->logArray['SEND_DATA_RESPONSE'].$this->newline;
return false;
}
return true;
}
// Function read response
private function readResponse() {
$data="";
while($str = fgets($this->smtpConnect,4096))
{
$data .= $str;
if(substr($str,3,1) == " ") { break; }
}
return $data;
}
// function send command to server
private function sendCommand($string) {
fputs($this->smtpConnect,$string.$this->newline);
return ;
}
// function send headers
private function sendHeaders() {
$from = (($to2 == false)? $this->username_email : $to);
$this->sendCommand("Date: ".date("D, j M Y G:i:s")." +0700");
$this->sendCommand("From: <{$from}>");
$this->sendCommand("Reply-To: <{$from}>");
$this->sendCommand("To: <{$this->to}>");
$this->sendCommand("Subject: {$this->subject}");
$this->sendCommand("MIME-Version: 1.0");
$this->sendCommand("Content-Type: text/html; charset={$this->charset}");
if ($this->contentTransferEncoding) $this->sendCommand("Content-Transfer-Encoding: {$this->contentTransferEncoding}");
return ;
}
public function __destruct() {
if (is_resource($this->smtpConnect)) fclose($this->smtpConnect);
}
}
?>
// Mail.php
class mail
{
private $smtpServer = 'smtp.site.com';
private $port = '25';
private $timeout = 30;
private $username = 'smtp_user';
private $password = 'smtp_pass';
private $username_email = 'admin@site.com';
private $newline = "\r\n";
private $localdomain = 'site.com';
private $charset = 'windows-1251';
private $contentTransferEncoding = false;
// Do not change anything below
private $smtpConnect = false;
private $to = false;
private $subject = false;
private $message = false;
private $headers = false;
private $logArray = array(); // Array response message for debug
private $Error = '';
public function __construct($to, $subject, $message, $to2 = false) {
$this->to = (($to2 !== false)? $this->username_email : $to);
$this->subject = &$subject;
$this->message = &$message;
// Connect to server
if(!$this->Connect2Server()) {
// Display error message
echo '<pre>'.trim($this->Error).'</pre>'.$this->newline.'<!-- '.$this->newline;
print_r($this->logArray);
echo $this->newline.'-->'.$this->newline;
return false;
}
return true;
}
private function Connect2Server() {
$from = (($to2 == false)? $this->username_email : $to);
// Connect to server
$this->smtpConnect = fsockopen($this->smtpServer,$this->port,$errno,$error,$this->timeout);
$this->logArray['CONNECT_RESPONSE'] = $this->readResponse();
if (!is_resource($this->smtpConnect)) {
return false;
}
$this->logArray['connection'] = "Connection accepted: {$smtpResponse}";
// Hi, server!
$this->sendCommand("HELO {$this->localdomain}");
$this->logArray['HELO'] = $this->readResponse();
// Let's know each other
$this->sendCommand('AUTH LOGIN');
$this->logArray['AUTH_REQUEST'] = $this->readResponse();
// My name...
$this->sendCommand(base64_encode($this->username));
$this->logArray['REQUEST_USER'] = $this->readResponse();
// My password..
$this->sendCommand(base64_encode($this->password));
$this->logArray['REQUEST_PASSWD'] = $this->readResponse();
// If error in response auth...
if (substr($this->logArray['REQUEST_PASSWD'],0,3)!='235') {
$this->Error .= 'Authorization error! '.$this->logArray['REQUEST_PASSWD'].$this->newline;
return false;
}
// "From" mail...
$this->sendCommand("MAIL FROM: {$from}");
$this->logArray['MAIL_FROM_RESPONSE'] = $this->readResponse();
if (substr($this->logArray['MAIL_FROM_RESPONSE'],0,3)!='250') {
$this->Error .= 'Mistake in sender\'s address! '.$this->logArray['MAIL_FROM_RESPONSE'].$this->newline;
return false;
}
// "To" address
$this->sendCommand("RCPT TO: {$this->to}");
$this->logArray['RCPT_TO_RESPONCE'] = $this->readResponse();
if(substr($this->logArray['RCPT_TO_RESPONCE'],0,3) != '250')
{
$this->Error .= 'Mistake in reciepent address! '.$this->logArray['RCPT_TO_RESPONCE'].$this->newline;
}
// Send data to server
$this->sendCommand('DATA');
$this->logArray['DATA_RESPONSE'] = $this->readResponse();
// Send mail message
if (!$this->sendMail()) return false;
// Good bye server! =)
$this->sendCommand('QUIT');
$this->logArray['QUIT_RESPONSE'] = $this->readResponse();
// Close smtp connect
fclose($this->smtpConnect);
return true;
}
// Function send mail
private function sendMail() {
$this->sendHeaders();
$this->sendCommand($this->message);
$this->sendCommand('.');
$this->logArray['SEND_DATA_RESPONSE'] = $this->readResponse();
if(substr($this->logArray['SEND_DATA_RESPONSE'],0,3)!='250') {
$this->Error .= 'Mistake in sending data! '.$this->logArray['SEND_DATA_RESPONSE'].$this->newline;
return false;
}
return true;
}
// Function read response
private function readResponse() {
$data="";
while($str = fgets($this->smtpConnect,4096))
{
$data .= $str;
if(substr($str,3,1) == " ") { break; }
}
return $data;
}
// function send command to server
private function sendCommand($string) {
fputs($this->smtpConnect,$string.$this->newline);
return ;
}
// function send headers
private function sendHeaders() {
$from = (($to2 == false)? $this->username_email : $to);
$this->sendCommand("Date: ".date("D, j M Y G:i:s")." +0700");
$this->sendCommand("From: <{$from}>");
$this->sendCommand("Reply-To: <{$from}>");
$this->sendCommand("To: <{$this->to}>");
$this->sendCommand("Subject: {$this->subject}");
$this->sendCommand("MIME-Version: 1.0");
$this->sendCommand("Content-Type: text/html; charset={$this->charset}");
if ($this->contentTransferEncoding) $this->sendCommand("Content-Transfer-Encoding: {$this->contentTransferEncoding}");
return ;
}
public function __destruct() {
if (is_resource($this->smtpConnect)) fclose($this->smtpConnect);
}
}
?>
- <?php
- // Mail.php
- class mail
- {
- private $smtpServer = 'smtp.site.com';
- private $port = '25';
- private $timeout = 30;
- private $username = 'smtp_user';
- private $password = 'smtp_pass';
- private $username_email = 'admin@site.com';
- private $newline = "\r\n";
- private $localdomain = 'site.com';
- private $charset = 'windows-1251';
- private $contentTransferEncoding = false;
- // Do not change anything below
- private $smtpConnect = false;
- private $to = false;
- private $subject = false;
- private $message = false;
- private $headers = false;
- private $logArray = array(); // Array response message for debug
- private $Error = '';
- public function __construct($to, $subject, $message, $to2 = false) {
- $this->to = (($to2 !== false)? $this->username_email : $to);
- $this->subject = &$subject;
- $this->message = &$message;
- // Connect to server
- if(!$this->Connect2Server()) {
- // Display error message
- echo '<pre>'.trim($this->Error).'</pre>'.$this->newline.'<!-- '.$this->newline;
- print_r($this->logArray);
- echo $this->newline.'-->'.$this->newline;
- return false;
- }
- return true;
- }
- private function Connect2Server() {
- $from = (($to2 == false)? $this->username_email : $to);
- // Connect to server
- $this->smtpConnect = fsockopen($this->smtpServer,$this->port,$errno,$error,$this->timeout);
- $this->logArray['CONNECT_RESPONSE'] = $this->readResponse();
- if (!is_resource($this->smtpConnect)) {
- return false;
- }
- $this->logArray['connection'] = "Connection accepted: {$smtpResponse}";
- // Hi, server!
- $this->sendCommand("HELO {$this->localdomain}");
- $this->logArray['HELO'] = $this->readResponse();
- // Let's know each other
- $this->sendCommand('AUTH LOGIN');
- $this->logArray['AUTH_REQUEST'] = $this->readResponse();
- // My name...
- $this->sendCommand(base64_encode($this->username));
- $this->logArray['REQUEST_USER'] = $this->readResponse();
- // My password..
- $this->sendCommand(base64_encode($this->password));
- $this->logArray['REQUEST_PASSWD'] = $this->readResponse();
- // If error in response auth...
- if (substr($this->logArray['REQUEST_PASSWD'],0,3)!='235') {
- $this->Error .= 'Authorization error! '.$this->logArray['REQUEST_PASSWD'].$this->newline;
- return false;
- }
- // "From" mail...
- $this->sendCommand("MAIL FROM: {$from}");
- $this->logArray['MAIL_FROM_RESPONSE'] = $this->readResponse();
- if (substr($this->logArray['MAIL_FROM_RESPONSE'],0,3)!='250') {
- $this->Error .= 'Mistake in sender\'s address! '.$this->logArray['MAIL_FROM_RESPONSE'].$this->newline;
- return false;
- }
- // "To" address
- $this->sendCommand("RCPT TO: {$this->to}");
- $this->logArray['RCPT_TO_RESPONCE'] = $this->readResponse();
- if(substr($this->logArray['RCPT_TO_RESPONCE'],0,3) != '250')
- {
- $this->Error .= 'Mistake in reciepent address! '.$this->logArray['RCPT_TO_RESPONCE'].$this->newline;
- }
- // Send data to server
- $this->sendCommand('DATA');
- $this->logArray['DATA_RESPONSE'] = $this->readResponse();
- // Send mail message
- if (!$this->sendMail()) return false;
- // Good bye server! =)
- $this->sendCommand('QUIT');
- $this->logArray['QUIT_RESPONSE'] = $this->readResponse();
- // Close smtp connect
- fclose($this->smtpConnect);
- return true;
- }
- // Function send mail
- private function sendMail() {
- $this->sendHeaders();
- $this->sendCommand($this->message);
- $this->sendCommand('.');
- $this->logArray['SEND_DATA_RESPONSE'] = $this->readResponse();
- if(substr($this->logArray['SEND_DATA_RESPONSE'],0,3)!='250') {
- $this->Error .= 'Mistake in sending data! '.$this->logArray['SEND_DATA_RESPONSE'].$this->newline;
- return false;
- }
- return true;
- }
- // Function read response
- private function readResponse() {
- $data="";
- while($str = fgets($this->smtpConnect,4096))
- {
- $data .= $str;
- if(substr($str,3,1) == " ") { break; }
- }
- return $data;
- }
- // function send command to server
- private function sendCommand($string) {
- fputs($this->smtpConnect,$string.$this->newline);
- return ;
- }
- // function send headers
- private function sendHeaders() {
- $from = (($to2 == false)? $this->username_email : $to);
- $this->sendCommand("Date: ".date("D, j M Y G:i:s")." +0700");
- $this->sendCommand("From: <{$from}>");
- $this->sendCommand("Reply-To: <{$from}>");
- $this->sendCommand("To: <{$this->to}>");
- $this->sendCommand("Subject: {$this->subject}");
- $this->sendCommand("MIME-Version: 1.0");
- $this->sendCommand("Content-Type: text/html; charset={$this->charset}");
- if ($this->contentTransferEncoding) $this->sendCommand("Content-Transfer-Encoding: {$this->contentTransferEncoding}");
- return ;
- }
- public function __destruct() {
- if (is_resource($this->smtpConnect)) fclose($this->smtpConnect);
- }
- }
- ?>
El smtpServer $ es el servidor SMTP que está utilizando. GMAIL hace esto, o usted puede usar el suyo si usted tiene uno.
El $ port es el número de puerto del servidor SMTP.
El $ usuario es el nombre de usuario utilizado para iniciar sesión en el servidor SMTP.
El $ password es la contraseña utilizada con el nombre de usuario para poder conectarse al servidor SMTP.
El $ username_email es su correo electrónico principal, donde el correo se enviará a.
El localdomain $ es su dominio.
Y para usarlo con su información...
Código: [ Select ]
<?php
/* Some required variables to configure this page */
// Variables not to be sent to you
$blocked = array('submit1');
// The email address the result of the form would be sent to.
$adm_email = 'your_email@your_host.com'
// The prefix to the mail
$mail_prefix = 'A ' . $_POST['service'] . ' request was sent to you from ' . $_POST['firstname'] . ' ' . $_POST['lastname'] . '\r\n <hr />';
// The post (signature) to the mail
$mail_post = null;
// The title for the message
$title = 'A ' . $_POST['service'] . ' request was sent to you from ' . $_POST['firstname'] . ' ' . $_POST['lastname'];
/* The actual code body for sending */
// Initiating the body var
$body = $mail_prefix;
// Initiating some numeric values that would be incremented in the following loop
$blocked_num = 0;
// Building the body for the mail
foreach($_POST as $field_name => $field_value)
{
// Building the body for the mail with the correct fields
if($field_name != $blocked[$blocked_num])
$body .= "<strong>{$field_name}</strong>: {$_POST[$field_name]}<br />\r\n";
// Initiating the blocked num counter if needed
if(count($blocked) < $blocked_num)
++$blocked_num;
}
// Ending the body var
$body .= $mail_post;
// Trimming the ends of body from any unneeded white spaces
$body = trim($body);
// Requiring the SMTP class
require_once 'mail.php';
// Initiating the mail object
$mail = new mail();
// Sending the message
if(new mail($_POST['email'], $title, $body, true))
echo 'The mail was successfully sent. Thank you for your time!';
else
echo 'There was an error in the mailling service.';
?>
/* Some required variables to configure this page */
// Variables not to be sent to you
$blocked = array('submit1');
// The email address the result of the form would be sent to.
$adm_email = 'your_email@your_host.com'
// The prefix to the mail
$mail_prefix = 'A ' . $_POST['service'] . ' request was sent to you from ' . $_POST['firstname'] . ' ' . $_POST['lastname'] . '\r\n <hr />';
// The post (signature) to the mail
$mail_post = null;
// The title for the message
$title = 'A ' . $_POST['service'] . ' request was sent to you from ' . $_POST['firstname'] . ' ' . $_POST['lastname'];
/* The actual code body for sending */
// Initiating the body var
$body = $mail_prefix;
// Initiating some numeric values that would be incremented in the following loop
$blocked_num = 0;
// Building the body for the mail
foreach($_POST as $field_name => $field_value)
{
// Building the body for the mail with the correct fields
if($field_name != $blocked[$blocked_num])
$body .= "<strong>{$field_name}</strong>: {$_POST[$field_name]}<br />\r\n";
// Initiating the blocked num counter if needed
if(count($blocked) < $blocked_num)
++$blocked_num;
}
// Ending the body var
$body .= $mail_post;
// Trimming the ends of body from any unneeded white spaces
$body = trim($body);
// Requiring the SMTP class
require_once 'mail.php';
// Initiating the mail object
$mail = new mail();
// Sending the message
if(new mail($_POST['email'], $title, $body, true))
echo 'The mail was successfully sent. Thank you for your time!';
else
echo 'There was an error in the mailling service.';
?>
- <?php
- /* Some required variables to configure this page */
- // Variables not to be sent to you
- $blocked = array('submit1');
- // The email address the result of the form would be sent to.
- $adm_email = 'your_email@your_host.com'
- // The prefix to the mail
- $mail_prefix = 'A ' . $_POST['service'] . ' request was sent to you from ' . $_POST['firstname'] . ' ' . $_POST['lastname'] . '\r\n <hr />';
- // The post (signature) to the mail
- $mail_post = null;
- // The title for the message
- $title = 'A ' . $_POST['service'] . ' request was sent to you from ' . $_POST['firstname'] . ' ' . $_POST['lastname'];
- /* The actual code body for sending */
- // Initiating the body var
- $body = $mail_prefix;
- // Initiating some numeric values that would be incremented in the following loop
- $blocked_num = 0;
- // Building the body for the mail
- foreach($_POST as $field_name => $field_value)
- {
- // Building the body for the mail with the correct fields
- if($field_name != $blocked[$blocked_num])
- $body .= "<strong>{$field_name}</strong>: {$_POST[$field_name]}<br />\r\n";
- // Initiating the blocked num counter if needed
- if(count($blocked) < $blocked_num)
- ++$blocked_num;
- }
- // Ending the body var
- $body .= $mail_post;
- // Trimming the ends of body from any unneeded white spaces
- $body = trim($body);
- // Requiring the SMTP class
- require_once 'mail.php';
- // Initiating the mail object
- $mail = new mail();
- // Sending the message
- if(new mail($_POST['email'], $title, $body, true))
- echo 'The mail was successfully sent. Thank you for your time!';
- else
- echo 'There was an error in the mailling service.';
- ?>
Espero que tuviera sentido. Y espero que ayuda a gif "alt =": D "title =" muy feliz ">
Acerca de lo de PEAR. Asegúrese de que Mail.php está en el directorio correcto y que el código se incluye la dirección correcta para Mail.php
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
- Bogey
- Bogey


- Registrado: Jul 14, 2005
- Mensajes: 8211
- Loc: USA
- Status: Offline
Puede enviar el código que tienes en sendemail.php?
A pesar de que no es importante. Permítanme tratar de explicar esto sin ver el código, pero si usted todavía tiene algunos problemas, ¿podría enviar el código de aquí, a menos que usted tiene miedo de la gente robando su trabajo.
incluyen (Mail.php);
Lo que está en el único entre comillas "", es la dirección en el archivo que desea incluir en el archivo actual (sendemail.php). Que es la dirección correcta?
Puede que tenga algo mal redactado, y si lo hacía, Im sentimos
A pesar de que no es importante. Permítanme tratar de explicar esto sin ver el código, pero si usted todavía tiene algunos problemas, ¿podría enviar el código de aquí, a menos que usted tiene miedo de la gente robando su trabajo.
incluyen (Mail.php);
Lo que está en el único entre comillas "", es la dirección en el archivo que desea incluir en el archivo actual (sendemail.php). Que es la dirección correcta?
Puede que tenga algo mal redactado, y si lo hacía, Im sentimos
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
Esto es lo que está en el sendemail.php
<?php
include("Mail.php");
$name = $_REQUEST['firsstname'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['textarea'] ;
$subject = $_REQUEST['service'] ;
/* mail setup recipients, subject etc */
$recipients = "feedback@yourdot.com";
$headers["From"] = "$email";
$headers["To"] = "email@example.com";
$headers["Subject"] = "$subject";
$mailmsg = "$subject";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "host.domain.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "username";
$smtpinfo["password"] = "password";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
?>
PHP Código: [ Select ]
<?php
include("Mail.php");
$name = $_REQUEST['firsstname'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['textarea'] ;
$subject = $_REQUEST['service'] ;
/* mail setup recipients, subject etc */
$recipients = "feedback@yourdot.com";
$headers["From"] = "$email";
$headers["To"] = "email@example.com";
$headers["Subject"] = "$subject";
$mailmsg = "$subject";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "host.domain.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "username";
$smtpinfo["password"] = "password";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
?>
- <?php
- include("Mail.php");
- $name = $_REQUEST['firsstname'] ;
- $email = $_REQUEST['email'] ;
- $message = $_REQUEST['textarea'] ;
- $subject = $_REQUEST['service'] ;
- /* mail setup recipients, subject etc */
- $recipients = "feedback@yourdot.com";
- $headers["From"] = "$email";
- $headers["To"] = "email@example.com";
- $headers["Subject"] = "$subject";
- $mailmsg = "$subject";
- /* SMTP server name, port, user/passwd */
- $smtpinfo["host"] = "host.domain.com";
- $smtpinfo["port"] = "25";
- $smtpinfo["auth"] = true;
- $smtpinfo["username"] = "username";
- $smtpinfo["password"] = "password";
- /* Create the mail object using the Mail::factory method */
- $mail_object =& Mail::factory("smtp", $smtpinfo);
- /* Ok send mail */
- $mail_object->send($recipients, $headers, $mailmsg);
- ?>
Use your words like arrows to shoot toward your goal.
- Bogey
- Bogey


- Registrado: Jul 14, 2005
- Mensajes: 8211
- Loc: USA
- Status: Offline
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
bin/wamp/bin/php/php5.2.9-2/PEAR/Structures/Mail.php.
Este archivo (mail.php) tiene los siguientes contenidos:
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
//
// $Id: Mail.php,v 1.17 2006/09/15 03:41:18 jon Exp $
require_once 'PEAR.php';
/**
* PEAR's Mail:: interface. Defines the interface for implementing
* mailers under the PEAR hierarchy, and provides supporting functions
* useful in multiple mailer backends.
*
* @access public
* @version $Revision: 1.17 $
* @package Mail
*/
class Mail
{
/**
* Line terminator used for separating header lines.
* @var string
*/
var $sep = "\r\n";
/**
* Provides an interface for generating Mail:: objects of various
* types
*
* @param string $driver The kind of Mail:: object to instantiate.
* @param array $params The parameters to pass to the Mail:: object.
* @return object Mail a instance of the driver class or if fails a PEAR Error
* @access public
*/
function &factory($driver, $params = array())
{
$driver = strtolower($driver);
@include_once 'Mail/' . $driver . '.php';
$class = 'Mail_' . $driver;
if (class_exists($class)) {
$mailer = new $class($params);
return $mailer;
} else {
return PEAR::raiseError('Unable to find class for driver ' . $driver);
}
}
/**
* Implements Mail::send() function using php's built-in mail()
* command.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
* @access public
* @deprecated use Mail_mail::send instead
*/
function send($recipients, $headers, $body)
{
$this->_sanitizeHeaders($headers);
// if we're passed an array of recipients, implode it.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
// get the Subject out of the headers array so that we can
// pass it as a seperate argument to mail().
$subject = '';
if (isset($headers['Subject'])) {
$subject = $headers['Subject'];
unset($headers['Subject']);
}
// flatten the headers out.
list(,$text_headers) = Mail::prepareHeaders($headers);
return mail($recipients, $subject, $body, $text_headers);
}
/**
* Sanitize an array of mail headers by removing any additional header
* strings present in a legitimate header's value. The goal of this
* filter is to prevent mail injection attacks.
*
* @param array $headers The associative array of headers to sanitize.
*
* @access private
*/
function _sanitizeHeaders(&$headers)
{
foreach ($headers as $key => $value) {
$headers[$key] =
preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\n|\r)\S).*=i',
null, $value);
}
}
/**
* Take an array of mail headers and return a string containing
* text usable in sending a message.
*
* @param array $headers The array of headers to prepare, in an associative
* array, where the array key is the header name (ie,
* 'Subject'), and the array value is the header
* value (ie, 'test'). The header produced from those
* values would be 'Subject: test'.
*
* @return mixed Returns false if it encounters a bad address,
* otherwise returns an array containing two
* elements: Any From: address found in the headers,
* and the plain text version of the headers.
* @access private
*/
function prepareHeaders($headers)
{
$lines = array();
$from = null;
foreach ($headers as $key => $value) {
if (strcasecmp($key, 'From') === 0) {
include_once 'Mail/RFC822.php';
$parser = &new Mail_RFC822();
$addresses = $parser->parseAddressList($value, 'localhost', false);
if (PEAR::isError($addresses)) {
return $addresses;
}
$from = $addresses[0]->mailbox . '@' . $addresses[0]->host;
// Reject envelope From: addresses with spaces.
if (strstr($from, ' ')) {
return false;
}
$lines[] = $key . ': ' . $value;
} elseif (strcasecmp($key, 'Received') === 0) {
$received = array();
if (is_array($value)) {
foreach ($value as $line) {
$received[] = $key . ': ' . $line;
}
}
else {
$received[] = $key . ': ' . $value;
}
// Put Received: headers at the top. Spam detectors often
// flag messages with Received: headers after the Subject:
// as spam.
$lines = array_merge($received, $lines);
} else {
// If $value is an array (i.e., a list of addresses), convert
// it to a comma-delimited string of its elements (addresses).
if (is_array($value)) {
$value = implode(', ', $value);
}
$lines[] = $key . ': ' . $value;
}
}
return array($from, join($this->sep, $lines));
}
/**
* Take a set of recipients and parse them, returning an array of
* bare addresses (forward paths) that can be passed to sendmail
* or an smtp server with the rcpt to: command.
*
* @param mixed Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid.
*
* @return mixed An array of forward paths (bare addresses) or a PEAR_Error
* object if the address list could not be parsed.
* @access private
*/
function parseRecipients($recipients)
{
include_once 'Mail/RFC822.php';
// if we're passed an array, assume addresses are valid and
// implode them before parsing.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
// Parse recipients, leaving out all personal info. This is
// for smtp recipients, etc. All relevant personal information
// should already be in the headers.
$addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
// If parseAddressList() returned a PEAR_Error object, just return it.
if (PEAR::isError($addresses)) {
return $addresses;
}
$recipients = array();
if (is_array($addresses)) {
foreach ($addresses as $ob) {
$recipients[] = $ob->mailbox . '@' . $ob->host;
}
}
return $recipients;
}
}
Este archivo (mail.php) tiene los siguientes contenidos:
Código: [ Select ]
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
//
// $Id: Mail.php,v 1.17 2006/09/15 03:41:18 jon Exp $
require_once 'PEAR.php';
/**
* PEAR's Mail:: interface. Defines the interface for implementing
* mailers under the PEAR hierarchy, and provides supporting functions
* useful in multiple mailer backends.
*
* @access public
* @version $Revision: 1.17 $
* @package Mail
*/
class Mail
{
/**
* Line terminator used for separating header lines.
* @var string
*/
var $sep = "\r\n";
/**
* Provides an interface for generating Mail:: objects of various
* types
*
* @param string $driver The kind of Mail:: object to instantiate.
* @param array $params The parameters to pass to the Mail:: object.
* @return object Mail a instance of the driver class or if fails a PEAR Error
* @access public
*/
function &factory($driver, $params = array())
{
$driver = strtolower($driver);
@include_once 'Mail/' . $driver . '.php';
$class = 'Mail_' . $driver;
if (class_exists($class)) {
$mailer = new $class($params);
return $mailer;
} else {
return PEAR::raiseError('Unable to find class for driver ' . $driver);
}
}
/**
* Implements Mail::send() function using php's built-in mail()
* command.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
* @access public
* @deprecated use Mail_mail::send instead
*/
function send($recipients, $headers, $body)
{
$this->_sanitizeHeaders($headers);
// if we're passed an array of recipients, implode it.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
// get the Subject out of the headers array so that we can
// pass it as a seperate argument to mail().
$subject = '';
if (isset($headers['Subject'])) {
$subject = $headers['Subject'];
unset($headers['Subject']);
}
// flatten the headers out.
list(,$text_headers) = Mail::prepareHeaders($headers);
return mail($recipients, $subject, $body, $text_headers);
}
/**
* Sanitize an array of mail headers by removing any additional header
* strings present in a legitimate header's value. The goal of this
* filter is to prevent mail injection attacks.
*
* @param array $headers The associative array of headers to sanitize.
*
* @access private
*/
function _sanitizeHeaders(&$headers)
{
foreach ($headers as $key => $value) {
$headers[$key] =
preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\n|\r)\S).*=i',
null, $value);
}
}
/**
* Take an array of mail headers and return a string containing
* text usable in sending a message.
*
* @param array $headers The array of headers to prepare, in an associative
* array, where the array key is the header name (ie,
* 'Subject'), and the array value is the header
* value (ie, 'test'). The header produced from those
* values would be 'Subject: test'.
*
* @return mixed Returns false if it encounters a bad address,
* otherwise returns an array containing two
* elements: Any From: address found in the headers,
* and the plain text version of the headers.
* @access private
*/
function prepareHeaders($headers)
{
$lines = array();
$from = null;
foreach ($headers as $key => $value) {
if (strcasecmp($key, 'From') === 0) {
include_once 'Mail/RFC822.php';
$parser = &new Mail_RFC822();
$addresses = $parser->parseAddressList($value, 'localhost', false);
if (PEAR::isError($addresses)) {
return $addresses;
}
$from = $addresses[0]->mailbox . '@' . $addresses[0]->host;
// Reject envelope From: addresses with spaces.
if (strstr($from, ' ')) {
return false;
}
$lines[] = $key . ': ' . $value;
} elseif (strcasecmp($key, 'Received') === 0) {
$received = array();
if (is_array($value)) {
foreach ($value as $line) {
$received[] = $key . ': ' . $line;
}
}
else {
$received[] = $key . ': ' . $value;
}
// Put Received: headers at the top. Spam detectors often
// flag messages with Received: headers after the Subject:
// as spam.
$lines = array_merge($received, $lines);
} else {
// If $value is an array (i.e., a list of addresses), convert
// it to a comma-delimited string of its elements (addresses).
if (is_array($value)) {
$value = implode(', ', $value);
}
$lines[] = $key . ': ' . $value;
}
}
return array($from, join($this->sep, $lines));
}
/**
* Take a set of recipients and parse them, returning an array of
* bare addresses (forward paths) that can be passed to sendmail
* or an smtp server with the rcpt to: command.
*
* @param mixed Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid.
*
* @return mixed An array of forward paths (bare addresses) or a PEAR_Error
* object if the address list could not be parsed.
* @access private
*/
function parseRecipients($recipients)
{
include_once 'Mail/RFC822.php';
// if we're passed an array, assume addresses are valid and
// implode them before parsing.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
// Parse recipients, leaving out all personal info. This is
// for smtp recipients, etc. All relevant personal information
// should already be in the headers.
$addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
// If parseAddressList() returned a PEAR_Error object, just return it.
if (PEAR::isError($addresses)) {
return $addresses;
}
$recipients = array();
if (is_array($addresses)) {
foreach ($addresses as $ob) {
$recipients[] = $ob->mailbox . '@' . $ob->host;
}
}
return $recipients;
}
}
- <?php
- //
- // +----------------------------------------------------------------------+
- // | PHP Version 4 |
- // +----------------------------------------------------------------------+
- // | Copyright (c) 1997-2003 The PHP Group |
- // +----------------------------------------------------------------------+
- // | This source file is subject to version 2.02 of the PHP license, |
- // | that is bundled with this package in the file LICENSE, and is |
- // | available at through the world-wide-web at |
- // | http://www.php.net/license/2_02.txt. |
- // | If you did not receive a copy of the PHP license and are unable to |
- // | obtain it through the world-wide-web, please send a note to |
- // | license@php.net so we can mail you a copy immediately. |
- // +----------------------------------------------------------------------+
- // | Author: Chuck Hagenbuch <chuck@horde.org> |
- // +----------------------------------------------------------------------+
- //
- // $Id: Mail.php,v 1.17 2006/09/15 03:41:18 jon Exp $
- require_once 'PEAR.php';
- /**
- * PEAR's Mail:: interface. Defines the interface for implementing
- * mailers under the PEAR hierarchy, and provides supporting functions
- * useful in multiple mailer backends.
- *
- * @access public
- * @version $Revision: 1.17 $
- * @package Mail
- */
- class Mail
- {
- /**
- * Line terminator used for separating header lines.
- * @var string
- */
- var $sep = "\r\n";
- /**
- * Provides an interface for generating Mail:: objects of various
- * types
- *
- * @param string $driver The kind of Mail:: object to instantiate.
- * @param array $params The parameters to pass to the Mail:: object.
- * @return object Mail a instance of the driver class or if fails a PEAR Error
- * @access public
- */
- function &factory($driver, $params = array())
- {
- $driver = strtolower($driver);
- @include_once 'Mail/' . $driver . '.php';
- $class = 'Mail_' . $driver;
- if (class_exists($class)) {
- $mailer = new $class($params);
- return $mailer;
- } else {
- return PEAR::raiseError('Unable to find class for driver ' . $driver);
- }
- }
- /**
- * Implements Mail::send() function using php's built-in mail()
- * command.
- *
- * @param mixed $recipients Either a comma-seperated list of recipients
- * (RFC822 compliant), or an array of recipients,
- * each RFC822 valid. This may contain recipients not
- * specified in the headers, for Bcc:, resending
- * messages, etc.
- *
- * @param array $headers The array of headers to send with the mail, in an
- * associative array, where the array key is the
- * header name (ie, 'Subject'), and the array value
- * is the header value (ie, 'test'). The header
- * produced from those values would be 'Subject:
- * test'.
- *
- * @param string $body The full text of the message body, including any
- * Mime parts, etc.
- *
- * @return mixed Returns true on success, or a PEAR_Error
- * containing a descriptive error message on
- * failure.
- * @access public
- * @deprecated use Mail_mail::send instead
- */
- function send($recipients, $headers, $body)
- {
- $this->_sanitizeHeaders($headers);
- // if we're passed an array of recipients, implode it.
- if (is_array($recipients)) {
- $recipients = implode(', ', $recipients);
- }
- // get the Subject out of the headers array so that we can
- // pass it as a seperate argument to mail().
- $subject = '';
- if (isset($headers['Subject'])) {
- $subject = $headers['Subject'];
- unset($headers['Subject']);
- }
- // flatten the headers out.
- list(,$text_headers) = Mail::prepareHeaders($headers);
- return mail($recipients, $subject, $body, $text_headers);
- }
- /**
- * Sanitize an array of mail headers by removing any additional header
- * strings present in a legitimate header's value. The goal of this
- * filter is to prevent mail injection attacks.
- *
- * @param array $headers The associative array of headers to sanitize.
- *
- * @access private
- */
- function _sanitizeHeaders(&$headers)
- {
- foreach ($headers as $key => $value) {
- $headers[$key] =
- preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\n|\r)\S).*=i',
- null, $value);
- }
- }
- /**
- * Take an array of mail headers and return a string containing
- * text usable in sending a message.
- *
- * @param array $headers The array of headers to prepare, in an associative
- * array, where the array key is the header name (ie,
- * 'Subject'), and the array value is the header
- * value (ie, 'test'). The header produced from those
- * values would be 'Subject: test'.
- *
- * @return mixed Returns false if it encounters a bad address,
- * otherwise returns an array containing two
- * elements: Any From: address found in the headers,
- * and the plain text version of the headers.
- * @access private
- */
- function prepareHeaders($headers)
- {
- $lines = array();
- $from = null;
- foreach ($headers as $key => $value) {
- if (strcasecmp($key, 'From') === 0) {
- include_once 'Mail/RFC822.php';
- $parser = &new Mail_RFC822();
- $addresses = $parser->parseAddressList($value, 'localhost', false);
- if (PEAR::isError($addresses)) {
- return $addresses;
- }
- $from = $addresses[0]->mailbox . '@' . $addresses[0]->host;
- // Reject envelope From: addresses with spaces.
- if (strstr($from, ' ')) {
- return false;
- }
- $lines[] = $key . ': ' . $value;
- } elseif (strcasecmp($key, 'Received') === 0) {
- $received = array();
- if (is_array($value)) {
- foreach ($value as $line) {
- $received[] = $key . ': ' . $line;
- }
- }
- else {
- $received[] = $key . ': ' . $value;
- }
- // Put Received: headers at the top. Spam detectors often
- // flag messages with Received: headers after the Subject:
- // as spam.
- $lines = array_merge($received, $lines);
- } else {
- // If $value is an array (i.e., a list of addresses), convert
- // it to a comma-delimited string of its elements (addresses).
- if (is_array($value)) {
- $value = implode(', ', $value);
- }
- $lines[] = $key . ': ' . $value;
- }
- }
- return array($from, join($this->sep, $lines));
- }
- /**
- * Take a set of recipients and parse them, returning an array of
- * bare addresses (forward paths) that can be passed to sendmail
- * or an smtp server with the rcpt to: command.
- *
- * @param mixed Either a comma-seperated list of recipients
- * (RFC822 compliant), or an array of recipients,
- * each RFC822 valid.
- *
- * @return mixed An array of forward paths (bare addresses) or a PEAR_Error
- * object if the address list could not be parsed.
- * @access private
- */
- function parseRecipients($recipients)
- {
- include_once 'Mail/RFC822.php';
- // if we're passed an array, assume addresses are valid and
- // implode them before parsing.
- if (is_array($recipients)) {
- $recipients = implode(', ', $recipients);
- }
- // Parse recipients, leaving out all personal info. This is
- // for smtp recipients, etc. All relevant personal information
- // should already be in the headers.
- $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
- // If parseAddressList() returned a PEAR_Error object, just return it.
- if (PEAR::isError($addresses)) {
- return $addresses;
- }
- $recipients = array();
- if (is_array($addresses)) {
- foreach ($addresses as $ob) {
- $recipients[] = $ob->mailbox . '@' . $ob->host;
- }
- }
- return $recipients;
- }
- }
Use your words like arrows to shoot toward your goal.
- Bogey
- Bogey


- Registrado: Jul 14, 2005
- Mensajes: 8211
- Loc: USA
- Status: Offline
¿El nombre de archivo tiene la capital "M" minúscula o "m"?
Intentar incluir ("../../ bin/php/php5.2.9-2/PEAR/Structures/Mail.php "); en lugar de incluir ( "Correo. php ");
No sé si el trabajo que...Im la falta de ideas
Intentar incluir ("../../ bin/php/php5.2.9-2/PEAR/Structures/Mail.php "); en lugar de incluir ( "Correo. php ");
No sé si el trabajo que...Im la falta de ideas
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
Capitolio.
También tengo otro con una minúscula ubicado en el directorio:
bin/wamp/bin/php/php5.2.9-2/PEAR/Mail/mail.php
que contiene este código:
También tengo otro con una minúscula ubicado en el directorio:
bin/wamp/bin/php/php5.2.9-2/PEAR/Mail/mail.php
que contiene este código:
Código: [ Select ]
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
//
// $Id: mail.php,v 1.18 2006/09/13 05:32:08 jon Exp $
/**
* internal PHP-mail() implementation of the PEAR Mail:: interface.
* @package Mail
* @version $Revision: 1.18 $
*/
class Mail_mail extends Mail {
/**
* Any arguments to pass to the mail() function.
* @var string
*/
var $_params = '';
/**
* Constructor.
*
* Instantiates a new Mail_mail:: object based on the parameters
* passed in.
*
* @param array $params Extra arguments for the mail() function.
*/
function Mail_mail($params = null)
{
/* The other mail implementations accept parameters as arrays.
* In the interest of being consistent, explode an array into
* a string of parameter arguments. */
if (is_array($params)) {
$this->_params = join(' ', $params);
} else {
$this->_params = $params;
}
/* Because the mail() function may pass headers as command
* line arguments, we can't guarantee the use of the standard
* "\r\n" separator. Instead, we use the system's native line
* separator. */
if (defined('PHP_EOL')) {
$this->sep = PHP_EOL;
} else {
$this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
}
}
/**
* Implements Mail_mail::send() function using php's built-in mail()
* command.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
*
* @access public
*/
function send($recipients, $headers, $body)
{
$this->_sanitizeHeaders($headers);
// If we're passed an array of recipients, implode it.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
// Get the Subject out of the headers array so that we can
// pass it as a seperate argument to mail().
$subject = '';
if (isset($headers['Subject'])) {
$subject = $headers['Subject'];
unset($headers['Subject']);
}
/*
* Also remove the To: header. The mail() function will add its own
* To: header based on the contents of $recipients.
*/
unset($headers['To']);
// Flatten the headers out.
$headerElements = $this->prepareHeaders($headers);
if (PEAR::isError($headerElements)) {
return $headerElements;
}
list(, $text_headers) = $headerElements;
/*
* We only use mail()'s optional fifth parameter if the additional
* parameters have been provided and we're not running in safe mode.
*/
if (empty($this->_params) || ini_get('safe_mode')) {
$result = mail($recipients, $subject, $body, $text_headers);
} else {
$result = mail($recipients, $subject, $body, $text_headers,
$this->_params);
}
/*
* If the mail() function returned failure, we need to create a
* PEAR_Error object and return it instead of the boolean result.
*/
if ($result === false) {
$result = PEAR::raiseError('mail() returned failure');
}
return $result;
}
}
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
//
// $Id: mail.php,v 1.18 2006/09/13 05:32:08 jon Exp $
/**
* internal PHP-mail() implementation of the PEAR Mail:: interface.
* @package Mail
* @version $Revision: 1.18 $
*/
class Mail_mail extends Mail {
/**
* Any arguments to pass to the mail() function.
* @var string
*/
var $_params = '';
/**
* Constructor.
*
* Instantiates a new Mail_mail:: object based on the parameters
* passed in.
*
* @param array $params Extra arguments for the mail() function.
*/
function Mail_mail($params = null)
{
/* The other mail implementations accept parameters as arrays.
* In the interest of being consistent, explode an array into
* a string of parameter arguments. */
if (is_array($params)) {
$this->_params = join(' ', $params);
} else {
$this->_params = $params;
}
/* Because the mail() function may pass headers as command
* line arguments, we can't guarantee the use of the standard
* "\r\n" separator. Instead, we use the system's native line
* separator. */
if (defined('PHP_EOL')) {
$this->sep = PHP_EOL;
} else {
$this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
}
}
/**
* Implements Mail_mail::send() function using php's built-in mail()
* command.
*
* @param mixed $recipients Either a comma-seperated list of recipients
* (RFC822 compliant), or an array of recipients,
* each RFC822 valid. This may contain recipients not
* specified in the headers, for Bcc:, resending
* messages, etc.
*
* @param array $headers The array of headers to send with the mail, in an
* associative array, where the array key is the
* header name (ie, 'Subject'), and the array value
* is the header value (ie, 'test'). The header
* produced from those values would be 'Subject:
* test'.
*
* @param string $body The full text of the message body, including any
* Mime parts, etc.
*
* @return mixed Returns true on success, or a PEAR_Error
* containing a descriptive error message on
* failure.
*
* @access public
*/
function send($recipients, $headers, $body)
{
$this->_sanitizeHeaders($headers);
// If we're passed an array of recipients, implode it.
if (is_array($recipients)) {
$recipients = implode(', ', $recipients);
}
// Get the Subject out of the headers array so that we can
// pass it as a seperate argument to mail().
$subject = '';
if (isset($headers['Subject'])) {
$subject = $headers['Subject'];
unset($headers['Subject']);
}
/*
* Also remove the To: header. The mail() function will add its own
* To: header based on the contents of $recipients.
*/
unset($headers['To']);
// Flatten the headers out.
$headerElements = $this->prepareHeaders($headers);
if (PEAR::isError($headerElements)) {
return $headerElements;
}
list(, $text_headers) = $headerElements;
/*
* We only use mail()'s optional fifth parameter if the additional
* parameters have been provided and we're not running in safe mode.
*/
if (empty($this->_params) || ini_get('safe_mode')) {
$result = mail($recipients, $subject, $body, $text_headers);
} else {
$result = mail($recipients, $subject, $body, $text_headers,
$this->_params);
}
/*
* If the mail() function returned failure, we need to create a
* PEAR_Error object and return it instead of the boolean result.
*/
if ($result === false) {
$result = PEAR::raiseError('mail() returned failure');
}
return $result;
}
}
- <?php
- //
- // +----------------------------------------------------------------------+
- // | PHP Version 4 |
- // +----------------------------------------------------------------------+
- // | Copyright (c) 1997-2003 The PHP Group |
- // +----------------------------------------------------------------------+
- // | This source file is subject to version 2.02 of the PHP license, |
- // | that is bundled with this package in the file LICENSE, and is |
- // | available at through the world-wide-web at |
- // | http://www.php.net/license/2_02.txt. |
- // | If you did not receive a copy of the PHP license and are unable to |
- // | obtain it through the world-wide-web, please send a note to |
- // | license@php.net so we can mail you a copy immediately. |
- // +----------------------------------------------------------------------+
- // | Author: Chuck Hagenbuch <chuck@horde.org> |
- // +----------------------------------------------------------------------+
- //
- // $Id: mail.php,v 1.18 2006/09/13 05:32:08 jon Exp $
- /**
- * internal PHP-mail() implementation of the PEAR Mail:: interface.
- * @package Mail
- * @version $Revision: 1.18 $
- */
- class Mail_mail extends Mail {
- /**
- * Any arguments to pass to the mail() function.
- * @var string
- */
- var $_params = '';
- /**
- * Constructor.
- *
- * Instantiates a new Mail_mail:: object based on the parameters
- * passed in.
- *
- * @param array $params Extra arguments for the mail() function.
- */
- function Mail_mail($params = null)
- {
- /* The other mail implementations accept parameters as arrays.
- * In the interest of being consistent, explode an array into
- * a string of parameter arguments. */
- if (is_array($params)) {
- $this->_params = join(' ', $params);
- } else {
- $this->_params = $params;
- }
- /* Because the mail() function may pass headers as command
- * line arguments, we can't guarantee the use of the standard
- * "\r\n" separator. Instead, we use the system's native line
- * separator. */
- if (defined('PHP_EOL')) {
- $this->sep = PHP_EOL;
- } else {
- $this->sep = (strpos(PHP_OS, 'WIN') === false) ? "\n" : "\r\n";
- }
- }
- /**
- * Implements Mail_mail::send() function using php's built-in mail()
- * command.
- *
- * @param mixed $recipients Either a comma-seperated list of recipients
- * (RFC822 compliant), or an array of recipients,
- * each RFC822 valid. This may contain recipients not
- * specified in the headers, for Bcc:, resending
- * messages, etc.
- *
- * @param array $headers The array of headers to send with the mail, in an
- * associative array, where the array key is the
- * header name (ie, 'Subject'), and the array value
- * is the header value (ie, 'test'). The header
- * produced from those values would be 'Subject:
- * test'.
- *
- * @param string $body The full text of the message body, including any
- * Mime parts, etc.
- *
- * @return mixed Returns true on success, or a PEAR_Error
- * containing a descriptive error message on
- * failure.
- *
- * @access public
- */
- function send($recipients, $headers, $body)
- {
- $this->_sanitizeHeaders($headers);
- // If we're passed an array of recipients, implode it.
- if (is_array($recipients)) {
- $recipients = implode(', ', $recipients);
- }
- // Get the Subject out of the headers array so that we can
- // pass it as a seperate argument to mail().
- $subject = '';
- if (isset($headers['Subject'])) {
- $subject = $headers['Subject'];
- unset($headers['Subject']);
- }
- /*
- * Also remove the To: header. The mail() function will add its own
- * To: header based on the contents of $recipients.
- */
- unset($headers['To']);
- // Flatten the headers out.
- $headerElements = $this->prepareHeaders($headers);
- if (PEAR::isError($headerElements)) {
- return $headerElements;
- }
- list(, $text_headers) = $headerElements;
- /*
- * We only use mail()'s optional fifth parameter if the additional
- * parameters have been provided and we're not running in safe mode.
- */
- if (empty($this->_params) || ini_get('safe_mode')) {
- $result = mail($recipients, $subject, $body, $text_headers);
- } else {
- $result = mail($recipients, $subject, $body, $text_headers,
- $this->_params);
- }
- /*
- * If the mail() function returned failure, we need to create a
- * PEAR_Error object and return it instead of the boolean result.
- */
- if ($result === false) {
- $result = PEAR::raiseError('mail() returned failure');
- }
- return $result;
- }
- }
Use your words like arrows to shoot toward your goal.
- Bogey
- Bogey


- Registrado: Jul 14, 2005
- Mensajes: 8211
- Loc: USA
- Status: Offline
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
esta es la cosa - yo no escribir ninguna de este código. Ive intentado ajustar para que funcione con mi forma, pero en vano. Tengo estos archivos, paquetes, addons, etc para php - pero no tienen idea de qué hacer con ellos.
La mayoría son de PEAR, creo que tengo algo de phpcodeguru.org, y uno de about.com. Tengo todos estos archivos y no saben cómo utilizarlas.
Me acuerdo de hacer una página con un formulario de contacto y no tener ningún problema con él debido a que el conjunto de seguridad de todos los php en el servidor, y yo simplemente escribió la forma html y utiliza el "post" para empujar a mail.php .
Esta vez, sin embargo, Im tener que configurar el smtp php y no tienen idea de lo que Im que hace. Ive nunca antes utilizado php. En este punto, no sé qué debo poner en mi index.html, mi directorio raíz, mi Mail.php o mail.php archivos. Im perdido
La mayoría son de PEAR, creo que tengo algo de phpcodeguru.org, y uno de about.com. Tengo todos estos archivos y no saben cómo utilizarlas.
Me acuerdo de hacer una página con un formulario de contacto y no tener ningún problema con él debido a que el conjunto de seguridad de todos los php en el servidor, y yo simplemente escribió la forma html y utiliza el "post" para empujar a mail.php .
Esta vez, sin embargo, Im tener que configurar el smtp php y no tienen idea de lo que Im que hace. Ive nunca antes utilizado php. En este punto, no sé qué debo poner en mi index.html, mi directorio raíz, mi Mail.php o mail.php archivos. Im perdido
Use your words like arrows to shoot toward your goal.
- mindfullsilence
- Professor


- Registrado: Ago 04, 2008
- Mensajes: 846
- Status: Offline
sendemail.php todavía me da errores. He cambiado la inclusión y la "firsstname" a "nombre"
Estos son los errores Im getting:
Estos son los errores Im getting:
Código: [ Select ]
Warning: include(Mail.php) [function.include]: failed to open stream: No such file or directory in C:\USR\bin\wamp\www\voltec\sendemail.php on line 2
Warning: include() [function.include]: Failed opening 'Mail.php' for inclusion (include_path='.;C:\php5\pear') in C:\USR\bin\wamp\www\voltec\sendemail.php on line 2
Warning: include() [function.include]: Failed opening 'Mail.php' for inclusion (include_path='.;C:\php5\pear') in C:\USR\bin\wamp\www\voltec\sendemail.php on line 2
- Warning: include(Mail.php) [function.include]: failed to open stream: No such file or directory in C:\USR\bin\wamp\www\voltec\sendemail.php on line 2
- Warning: include() [function.include]: Failed opening 'Mail.php' for inclusion (include_path='.;C:\php5\pear') in C:\USR\bin\wamp\www\voltec\sendemail.php on line 2
Use your words like arrows to shoot toward your goal.
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Junio 25th, 2009, 9:10 am
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 40 mensajes
- Usuarios navegando por este Foro: Kurthead+1, ScottG y 108 invitados
- No puede abrir nuevos temas en este Foro
- No puede responder a temas en este Foro
- No puede editar sus mensajes en este Foro
- No puede borrar sus mensajes en este Foro
- No puede enviar adjuntos en este Foro
