SMTP mail avec PEAR et Wampserver?
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
honnêtement, Ive été à travailler sur ce pendant des jours et ont reçu nulle part. Aucune idée de ce que d'écrire du code, aucune idée de comment l'obtenir de lui envoyer, aucune idée d'où j'ai quitté mon cerveau quand il a fui de ma tête.
Id code post pour vous les gars à regarder, mais je n'ai pas, comme je l'ai dit, rien ne fonctionne, ni même à proximité.
J'ai besoin d'un formulaire sur ce site: http://173.11.86.101/voltec/ pour écrire à un fichier php qui fonctionne avec des poires mail addon.
Ive a examiné environ 20 différents sites, de lire les tutoriaux bogey posté ici, ainsi que 10 - 15 Tuts ailleurs. Toute aide les gars?
Id code post pour vous les gars à regarder, mais je n'ai pas, comme je l'ai dit, rien ne fonctionne, ni même à proximité.
J'ai besoin d'un formulaire sur ce site: http://173.11.86.101/voltec/ pour écrire à un fichier php qui fonctionne avec des poires mail addon.
Ive a examiné environ 20 différents sites, de lire les tutoriaux bogey posté ici, ainsi que 10 - 15 Tuts ailleurs. Toute aide les gars?
Use your words like arrows to shoot toward your goal.
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Juin 24th, 2009, 9:44 pm
- Bogey
- Bogey


- Inscription: Juil 14, 2005
- Messages: 8211
- Loc: USA
- Status: Offline
Montrez-moi le mail de PEAR addon...pouvez-vous expliquer le problème un peu plus? Qu'est-ce qui vous...ces choses que vous voulez dans le formulaire qui vous est envoyé par e-mail?
Je peux vous envoyer le SMTP de classe et que je me suis un peu modifié...il fonctionne parfaitement. (Je l'utiliser pour envoyer la vérification des comptes, contactez-moi, ou un utilisateur à l'envoi de courrier électronique et mes autres besoins emailing).
Il semble que les poires mail addon est absent au moins une dépendance. (Mail.php demandé dans sendemail.php).
Je peux vous envoyer le SMTP de classe et que je me suis un peu modifié...il fonctionne parfaitement. (Je l'utiliser pour envoyer la vérification des comptes, contactez-moi, ou un utilisateur à l'envoi de courrier électronique et mes autres besoins emailing).
Il semble que les poires mail addon est absent au moins une dépendance. (Mail.php demandé dans sendemail.php).
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
Je crois cet est la poire thats paquet installé
php 5, la nouvelle version stable.
oui, je veux que les données de formulaire à envoyer à un e-mail par l'intermédiaire d'un serveur SMTP lors de l'utilisateur hits soumettre.
php 5, la nouvelle version stable.
oui, je veux que les données de formulaire à envoyer à un e-mail par l'intermédiaire d'un serveur SMTP lors de l'utilisateur hits soumettre.
Use your words like arrows to shoot toward your goal.
- Bogey
- Bogey


- Inscription: Juil 14, 2005
- Messages: 8211
- Loc: USA
- Status: Offline
La classe SMTP que j'utilise est...
Le $ smtpServer est le serveur SMTP que vous utilisez. Gmail ne présente, ou vous pouvez utiliser le vôtre si vous en avez un.
Le $ port est le numéro de port du serveur SMTP.
Le $ username est le nom utilisé pour ouvrir une session sur le serveur SMTP.
Le $ password est le mot de passe utilisé avec le nom d'utilisateur à se connecter au serveur SMTP.
Le $ username_email est votre email principal, où le courrier sera envoyé à.
Le $ localdomain est votre domaine.
Et de l'utiliser avec vos informations...
J'espère que cela avait un sens. Et I hope that helps gif "alt =": D "title =" très heureux ">
A propos de la chose PEAR. Assurez-vous que Mail.php est dans le répertoire correct et que le code a inclure l'adresse correcte à Mail.php
Code: [ 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);
- }
- }
- ?>
Le $ smtpServer est le serveur SMTP que vous utilisez. Gmail ne présente, ou vous pouvez utiliser le vôtre si vous en avez un.
Le $ port est le numéro de port du serveur SMTP.
Le $ username est le nom utilisé pour ouvrir une session sur le serveur SMTP.
Le $ password est le mot de passe utilisé avec le nom d'utilisateur à se connecter au serveur SMTP.
Le $ username_email est votre email principal, où le courrier sera envoyé à.
Le $ localdomain est votre domaine.
Et de l'utiliser avec vos informations...
Code: [ 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.';
- ?>
J'espère que cela avait un sens. Et I hope that helps gif "alt =": D "title =" très heureux ">
A propos de la chose PEAR. Assurez-vous que Mail.php est dans le répertoire correct et que le code a inclure l'adresse correcte à Mail.php
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
- Bogey
- Bogey


- Inscription: Juil 14, 2005
- Messages: 8211
- Loc: USA
- Status: Offline
Pouvez-vous envoyer le code que vous avez reçu en sendemail.php?
Bien que ce n'est pas important. Permettez-moi d'essayer d'expliquer ce sans voir le code, mais si vous avez encore des problèmes, pouvez-vous s'il vous plaît envoyer le code ici, sauf si vous avez peur de voler des gens de votre travail.
include (Mail.php);
Tout ce qui est entre les guillemets simples "", est l'adresse du fichier que vous souhaitez inclure dans le dossier courant (sendemail.php). Est-ce l'adresse correcte?
Je mai ont rédigé quelque chose de mal, et si je les avais, Im sorry
Bien que ce n'est pas important. Permettez-moi d'essayer d'expliquer ce sans voir le code, mais si vous avez encore des problèmes, pouvez-vous s'il vous plaît envoyer le code ici, sauf si vous avez peur de voler des gens de votre travail.
include (Mail.php);
Tout ce qui est entre les guillemets simples "", est l'adresse du fichier que vous souhaitez inclure dans le dossier courant (sendemail.php). Est-ce l'adresse correcte?
Je mai ont rédigé quelque chose de mal, et si je les avais, Im sorry
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
C'est ce qui est dans l'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 Code: [ 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


- Inscription: Juil 14, 2005
- Messages: 8211
- Loc: USA
- Status: Offline
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
bin/wamp/bin/php/php5.2.9-2/PEAR/Structures/Mail.php.
Ce fichier (mail.php) a ce contenu:
<?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;
}
}
Ce fichier (mail.php) a ce contenu:
Code: [ 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


- Inscription: Juil 14, 2005
- Messages: 8211
- Loc: USA
- Status: Offline
Est-ce que le nom du fichier est de la capitale "M" ou minuscule "m"?
Essayer inclure ("../../ bin/php/php5.2.9-2/PEAR/Structures/Mail.php "); au lieu de include ( "Mail. php ");
Je ne sais pas si ce serait...Au cours d'idées
Essayer inclure ("../../ bin/php/php5.2.9-2/PEAR/Structures/Mail.php "); au lieu de include ( "Mail. php ");
Je ne sais pas si ce serait...Au cours d'idées
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
Capitol.
J'ai aussi un autre avec une minuscule situé dans le répertoire:
bin/wamp/bin/php/php5.2.9-2/PEAR/Mail/mail.php
Il contient ce code:
J'ai aussi un autre avec une minuscule situé dans le répertoire:
bin/wamp/bin/php/php5.2.9-2/PEAR/Mail/mail.php
Il contient ce code:
Code: [ 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


- Inscription: Juil 14, 2005
- Messages: 8211
- Loc: USA
- Status: Offline
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
ce est la chose - je n'ai pas tout écrire du code. Jai tenté d'ajuster à travailler avec mon formulaire, mais sans succès. J'ai de ces fichiers, les colis, les addons, etc php - mais n'ont aucune idée de quoi faire avec eux.
La plupart sont de PEAR, je crois avoir quelques-uns de phpcodeguru.org, et un de about.com. J'ai tous ces fichiers et ne pas savoir comment les utiliser.
Je me souviens de faire un site avec un formulaire de contact et de ne pas avoir de problèmes avec elle parce que l'accueil mis en place tous les php sur le serveur, et j'ai écrit tout simplement le formulaire html et a utilisé le "post" action de pousser à Mail.php .
Cette fois, cependant, Im avoir à configurer le smtp php et n'ont aucune idée de ce fait Im. Php Ive jamais utilisé auparavant. À ce point, je ne sais pas ce que je dois mettre dans mon index.html, mon répertoire racine, ma Mail.php Mail.php ou fichiers. Im perdu
La plupart sont de PEAR, je crois avoir quelques-uns de phpcodeguru.org, et un de about.com. J'ai tous ces fichiers et ne pas savoir comment les utiliser.
Je me souviens de faire un site avec un formulaire de contact et de ne pas avoir de problèmes avec elle parce que l'accueil mis en place tous les php sur le serveur, et j'ai écrit tout simplement le formulaire html et a utilisé le "post" action de pousser à Mail.php .
Cette fois, cependant, Im avoir à configurer le smtp php et n'ont aucune idée de ce fait Im. Php Ive jamais utilisé auparavant. À ce point, je ne sais pas ce que je dois mettre dans mon index.html, mon répertoire racine, ma Mail.php Mail.php ou fichiers. Im perdu
Use your words like arrows to shoot toward your goal.
- mindfullsilence
- Professor


- Inscription: Aoû 04, 2008
- Messages: 846
- Status: Offline
sendemail.php me donne encore des erreurs. J'ai changé le programme et le firsstname "" à "prénom"
Ce sont les erreurs Im obtenant:
Ce sont les erreurs Im obtenant:
Code: [ 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


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Juin 25th, 2009, 9:10 am
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
Afficher de l'information
- Total des messages de ce sujet: 40 messages
- Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 121 invités
- Vous ne pouvez pas poster de nouveaux sujets
- Vous ne pouvez pas répondre aux sujets
- Vous ne pouvez pas éditer vos messages
- Vous ne pouvez pas supprimer vos messages
- Vous ne pouvez pas joindre des fichiers
