UtopiaSoftware Forums

Full Version: Mail list error utopia news 1.4.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there

I just installed the new version of Utopia News Pro and I am having trouble with the email feature in the "Post News" section.

When trying to send a post to the mailinglist, I receive following error: "Warning: mail() [function.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 [..]postnews.php on line 79"

I recon that this has to do something with the fact that I cannot use "localhost" as route for my MySQL server, nor for my mail server. Where can I modify mail server settings in the script?

Cheers
Laurens
This is a configuration issue with PHP and the mail server. The script uses the simple php mail() function, which is called directly in postnews.php. If you need to modify the call of the mail() function, it can be done there, but the solution to this probably lies in changing the config of PHP in the php.ini file.

Brian Wrote:
This is a configuration issue with PHP and the mail server. The script uses the simple php mail() function, which is called directly in postnews.php. If you need to modify the call of the mail() function, it can be done there, but the solution to this probably lies in changing the config of PHP in the php.ini file.


Hi Brian, thanks for your answer. I have checked with my hosting company, and apparently I have to use PHPmailer, as the normal mail() function does not work. This is the code they have given me to use:
<?
require("c:\php\includes\class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();
$mail->Host = "xx";
$mail->SMTPAuth = true;
$mail->Username = "test@test.biz";
$mail->Password = "xx";

$mail->From = "test@test.biz";
$mail->FromName = "Laurens";
$mail->AddReplyTo("you@domain.com");
$mail->AddAddress("user@domain.com");
$mail->IsHTML(true);
$mail->Subject = "Test message sent using the PHPMailer component";
$mail->Body = "This is a test message.";
$mail->Send()
?>

This code works on the server, but I have no clue how to integrate it in postnews.php. I am afraid I am not that PHP literate. Could you help me out with this?

Cheers
Laurens

Ok, try this out. Let me know if you have any problems.

Open postnews.php, and find:

PHP Code:
for ($i 1$i <= $emailscount$i++)
                {
                    
$index $i-1;
                    
mail(trim($emailslist[$index]), "$sitetitle News Update"$message"From: $techemail\nContent-Type: text/html");
                } 


Replace with:

PHP Code:
require("c:\php\includes\class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();
$mail->Host "xx";
$mail->SMTPAuth true;
$mail->Username "test@test.biz";
$mail->Password "xx";
for (
$i 1$i <= $emailscount$i++)
{
$index $i-1;
$mail->From $techemail;
$mail->FromName "Laurens";
$mail->AddReplyTo($techemail);
$mail->AddAddress($emailslist[$index]);
$mail->IsHTML(true);
$mail->Subject "$sitetitle News Update";
$mail->Body $message;
$mail->Send();

Reference URL's