Page 1 of 1

phpmailer issue

Posted: Fri Aug 17, 2007 9:54 am
by mad_phpq
Hi,

I having problems with the phpmailer function. I'm getting the error below

Message was not sent.Mailer error: Language string failed to load: recipients_failedme@here.com

Anyone know what i should be look for?

Below is the code

Code: Select all

<?php

ini_set("include_path", "c:\wamp\phpmailer");

require("class.phpmailer.php");
require("class.smtp.php");
require("language/phpmailer.lang-en.php");


$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "localhost"; // SMTP server

$mail->From = "me@here.com";
$mail->FromName = "Joe Bloggs";
$mail->AddAddress("me@there.com");

$mail->Subject = "First PHPMailer Message";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send())
{
   echo 'Message was not sent.';
   echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
   echo 'Message has been sent.';
}

?>

Posted: Fri Aug 17, 2007 3:58 pm
by thewebdrivers
Ok this is a very common error associated with phpmailer. It is because class.phplistmailer is instantiated in /admin, its parent class (class.phpmailer) is instantiated in /admin/phpmailer.

IN CLASS.PHPLISTMAILER:PHP LINE #4 change this:

require( $GLOBALS"coderoot"] . "phpmailer/class.phpmailer.php");

FOR:

require( $GLOBALS["coderoot"] . "/phpmailer/class.phpmailer.php");