Mi aplicación no envia correos phpnuke, phpbb etc.,

El sistema no permite usar el usuario "nobody" para enviar correos a direcciones
remotas, algunos scripts php y cgi envian correo como `nobody`.
Puede modificar el script para que use autenticación SMTP puede ver un ejemplo a
continuación, este fue tomado de:

http://codewalkers.com/seecode/538.html

 

*******************************************



//Authenticate Send - 21st March 2005
//This will send an email using auth smtp and output a log array
//logArray - connection, function authSendEmail($from, $namefrom, $to, $nameto, $subject, $message)
{
//SMTP + SERVER DETAILS
/* * * * CONFIGURATION START * * * */
$smtpServer = "mail.server.com";
$port = "25";
$timeout = "30";
$username = "smtpusername";
$password = "smtppassword";
$localhost = "localhost";
$newLine = "\r\n";
/* * * * CONFIGURATION END * * * * */

//Connect to the host on the specified port
$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
$smtpResponse = fgets($smtpConnect, 515);
if(empty($smtpConnect))
{
$output = "Failed to connect: $smtpResponse";
return $output;
}
else
{
$logArray['connection'] = "Connected: $smtpResponse";
}

//Request Auth Login
fputs($smtpConnect,"AUTH LOGIN" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authrequest'] = "$smtpResponse";

//Send username
fputs($smtpConnect, base64_encode($username) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authusername'] = "$smtpResponse";

//Send password
fputs($smtpConnect, base64_encode($password) . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['authpassword'] = "$smtpResponse";

//Say Hello to SMTP
fputs($smtpConnect, "HELO $localhost" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['heloresponse'] = "$smtpResponse";

//Email From
fputs($smtpConnect, "MAIL FROM: $from" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailfromresponse'] = "$smtpResponse";

//Email To
fputs($smtpConnect, "RCPT TO: $to" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['mailtoresponse'] = "$smtpResponse";

//The Email
fputs($smtpConnect, "DATA" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data1response'] = "$smtpResponse";

//Construct Headers
$headers = "MIME-Version: 1.0" . $newLine;
$headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine;
$headers .= "To: $nameto <$to>" . $newLine;
$headers .= "From: $namefrom <$from>" . $newLine;

fputs($smtpConnect, "To: $to\nFrom: $from\nSubject: $subject\n$headers\n\n$message\n.\n");
$smtpResponse = fgets($smtpConnect, 515);
$logArray['data2response'] = "$smtpResponse";

// Say Bye to SMTP
fputs($smtpConnect,"QUIT" . $newLine);
$smtpResponse = fgets($smtpConnect, 515);
$logArray['quitresponse'] = "$smtpResponse";
} ?>


***************************************************


 

  • 37 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

Cuales son los Links de las Aplicaciones preinstaladas Softaculous

Como un servicio adicional a los planes de 500Mb o más sin costo extra, americandominios ofrece a...

Que es un banner

Un banner es un elemento promocional de tu site web en otros sites. Normalmente(99.99% de los...

Como se cambia el Idioma en nohah classifieds

el idioma se cambia en el archivo constants.php

Tienen algunos Links para phpnuke ?

LINKS EN ESPAÑOL DE PHPNUKE DONDE PUEDE ENCONTRAR AYUDAShttp://www.phpnuke-espanol.org PHP-Nuke...

Como creo un chat externo IRC que se vea desde mi pagina?

Se recomienda crear un canal en unas de las grandes redes IRC (Internet Relay Chat) que existen...