Ginos
30-01-2008, 20:06
La connessione al database ora va ma purtroppo ora mi continua a dare questi errori:
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in
oppure l'errore 501 invalid address . (Mi indica gli errori sempre su entrambe le linee evidenziate in grassetto qui sotto. Dipende da come invio la mail: o in TXT o in HTML)
Non so più cosa modificare!
L'errore mi viene segnalato nel file listsend.it dove risiede la funzione mail()
Questo il codice del file listsend.php:
Citazione:
<? include("listconfig.php"); ?>
<html>
<head>
<title>vList Lite Administrative Interface</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
ini_set( "SMTP","localhost" ); (questa funzione l'ho aggiunta io per testarlo in locale ora non so se bisogna lasciarla o meno)
if ($Submit=="Send Now!")
{
// Security
$subject = strip_tags($subject);
$TEXTMailText = stripslashes($MailText); // put nl2br() if not showing newline properly in email messages
$connection = mysql_connect($dbhost, $dbusername, $dbpassword);
$query = "SELECT * FROM listsubscribers";
$result = mysql_db_query($dbname, $query);
if ($row = mysql_fetch_array($result))
{
$EmailTo = $row["email"];
$ok = true;
}
while ($row = mysql_fetch_array($result))
{
$EmailTo .= ", " . $row["email"];
$ok = true;
}
if (($mailtype=="text") && ($ok))
{
$Message = $TEXTMailText;
$Message .= $TXTfooter;
$sent = mail ($SenderFrom. "<" . $EmailFrom. ">" , $subject, $Message, "From:$SenderFrom<$EmailFrom>\nReply-to:$EmailReplyTo
\nbcc:$EmailTo" ) ;
}
elseif (($mailtype=="html") && ($ok))
{
$Message = $MailText; // Send HTML mail as it was entered in multi line text box
$Message .= $HTMLfooter;
$sent = mail( $SenderFrom. "<" . $EmailFrom. ">" , $subject, $Message, "From:$SenderFrom<$EmailFrom>\nReply-to:$EmailReplyTo
\nbcc:$EmailTo\nContent-Type:text/html; charset=iso-8859-1" ) ;
}
}
?>
Queste le variabili nel file listconfig.php:
Citazione:
<?
// Database settings
$dbhost = "localhost"; // change this to reflect your db host name
$dbusername = "******"; // change this to reflect your db username
$dbpassword = "******"; // change this to reflect your db password
$dbport = "3306"; // default is 3306; change this if different
$dbname = "*******"; // name of the database
// ***** Email Settings *****
// Value for the FROM field of the message to member
$SenderFrom = "TEST MAIL" ;
// email address that will show from the email you sent. every email sent to the list would also be sent here
$EmailFrom = "mio_indirizzo@dominio.it" ;(E' corretto inserire il mio indirizzo in questa variabile anche se l'SMTP è impostato su localhost?)
// email address where list member replies will be sent
$EmailReplyTo = "mio_indirizzo@dominio.it" ;
(
// URL of listunsubscribe.php - Change this to reflect your settings
$UnsubscribeURL = "http://www.domain.net/vListLite/listunsubscribe.php";
// unsubscribe text version - you may opt to change this
$TXTfooter = "\n\n---------------------------------------------\nTo unsubscribe from this mailing list, please click on the URL below OR if this is not possible, copy and paste the URL into your web browser and then enter your email address in the field provided. The URL is: " . $UnsubscribeURL;
// unsubscribe html version - you may opt to change this
$HTMLfooter = "<br><BR>---------------------------------------------<br><font face=\"Verdana\" size=\"1\">To unsubscribe from this mailing list, please click on the URL below OR if this is not possible, copy and paste the URL into your web browser and then enter your email address in the field provided. The URL is: " . $UnsubscribeURL;
?>
Ovviamente il tutto funziona alla grande in locale! Sicuramente sarà qualche problema di configurazione (l'applicativo era già compilato).
Ragazzi entro oggi dovrei renderlo funzionante mi aiutate per favore?
Grazie mille
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in
oppure l'errore 501 invalid address . (Mi indica gli errori sempre su entrambe le linee evidenziate in grassetto qui sotto. Dipende da come invio la mail: o in TXT o in HTML)
Non so più cosa modificare!
L'errore mi viene segnalato nel file listsend.it dove risiede la funzione mail()
Questo il codice del file listsend.php:
Citazione:
<? include("listconfig.php"); ?>
<html>
<head>
<title>vList Lite Administrative Interface</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
ini_set( "SMTP","localhost" ); (questa funzione l'ho aggiunta io per testarlo in locale ora non so se bisogna lasciarla o meno)
if ($Submit=="Send Now!")
{
// Security
$subject = strip_tags($subject);
$TEXTMailText = stripslashes($MailText); // put nl2br() if not showing newline properly in email messages
$connection = mysql_connect($dbhost, $dbusername, $dbpassword);
$query = "SELECT * FROM listsubscribers";
$result = mysql_db_query($dbname, $query);
if ($row = mysql_fetch_array($result))
{
$EmailTo = $row["email"];
$ok = true;
}
while ($row = mysql_fetch_array($result))
{
$EmailTo .= ", " . $row["email"];
$ok = true;
}
if (($mailtype=="text") && ($ok))
{
$Message = $TEXTMailText;
$Message .= $TXTfooter;
$sent = mail ($SenderFrom. "<" . $EmailFrom. ">" , $subject, $Message, "From:$SenderFrom<$EmailFrom>\nReply-to:$EmailReplyTo
\nbcc:$EmailTo" ) ;
}
elseif (($mailtype=="html") && ($ok))
{
$Message = $MailText; // Send HTML mail as it was entered in multi line text box
$Message .= $HTMLfooter;
$sent = mail( $SenderFrom. "<" . $EmailFrom. ">" , $subject, $Message, "From:$SenderFrom<$EmailFrom>\nReply-to:$EmailReplyTo
\nbcc:$EmailTo\nContent-Type:text/html; charset=iso-8859-1" ) ;
}
}
?>
Queste le variabili nel file listconfig.php:
Citazione:
<?
// Database settings
$dbhost = "localhost"; // change this to reflect your db host name
$dbusername = "******"; // change this to reflect your db username
$dbpassword = "******"; // change this to reflect your db password
$dbport = "3306"; // default is 3306; change this if different
$dbname = "*******"; // name of the database
// ***** Email Settings *****
// Value for the FROM field of the message to member
$SenderFrom = "TEST MAIL" ;
// email address that will show from the email you sent. every email sent to the list would also be sent here
$EmailFrom = "mio_indirizzo@dominio.it" ;(E' corretto inserire il mio indirizzo in questa variabile anche se l'SMTP è impostato su localhost?)
// email address where list member replies will be sent
$EmailReplyTo = "mio_indirizzo@dominio.it" ;
(
// URL of listunsubscribe.php - Change this to reflect your settings
$UnsubscribeURL = "http://www.domain.net/vListLite/listunsubscribe.php";
// unsubscribe text version - you may opt to change this
$TXTfooter = "\n\n---------------------------------------------\nTo unsubscribe from this mailing list, please click on the URL below OR if this is not possible, copy and paste the URL into your web browser and then enter your email address in the field provided. The URL is: " . $UnsubscribeURL;
// unsubscribe html version - you may opt to change this
$HTMLfooter = "<br><BR>---------------------------------------------<br><font face=\"Verdana\" size=\"1\">To unsubscribe from this mailing list, please click on the URL below OR if this is not possible, copy and paste the URL into your web browser and then enter your email address in the field provided. The URL is: " . $UnsubscribeURL;
?>
Ovviamente il tutto funziona alla grande in locale! Sicuramente sarà qualche problema di configurazione (l'applicativo era già compilato).
Ragazzi entro oggi dovrei renderlo funzionante mi aiutate per favore?
Grazie mille