phpmailer issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mad_phpq
Forum Commoner
Posts: 85
Joined: Fri Apr 27, 2007 5:53 am

phpmailer issue

Post 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.';
}

?>
thewebdrivers
Forum Commoner
Posts: 41
Joined: Fri Aug 17, 2007 3:32 pm
Location: india
Contact:

Post 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");
Post Reply