1. Code Spew
2. Configuration problems
3. connection error
4. Firewall configuration
5. check your “From line”
6. add the black list table to your DB
1. Code Spew
Or name it “Some unprocessed PHP”, “garbage” etc.
This is a short version of the post:
http://forums.phplist.com/viewtopic.php?p=36664#36664
reason: there are different ways of starting php code. Today’s standard is '<?php' but some servers allow old forms like '<?' etc.
The solution is to search all files in the phplist installation for <? and replace them with <?php.
FIRST BACKUP YOUR PHPLIST DIRECTORY!!!!!!!!!!!!!!!!!!
Use Dreamweaver for the first one use regular expressions:
Search: <\?(?=\s)
Replace: <?php
(10 items replaced)
There are several files that also have <?= ?> tags that will cause a problem as well.
Use Dreamweavers search & replace but NO REGEX.
Search: <?=
Replace: <?php echo
!!!! AGAIN, CAREFULL NO REGEX!!!
(7 items replaced)
Don't forget to put a trailing space after echo or it won't work properly.
Something went wrong? You used regex for the second replace? You don't have a backup?
I am truly sorry! Check out the original thread there might be a cure.
2. configuration:
Problem: Message sending failed.
Open config/config.php
define ("TEST",0); Default is on 1!!!
and much further down ?!?
define("PHPMAILERHOST",'mail.yourdomain.com');
$phpmailer_smtpuser = 'user';
$phpmailer_smtppassword = 'pwd';
3. connection error
In eventlog: Mailer Error: SMTP Error: Could not connect to SMTP host.
It was a firewall problem AND another problem which made me believe I do not have a firewall problem. Well, this is what happens, if you turn your firewall of and the problem doesn't disappear. You think it's not the firewall and turn it on again.
Than you try to fix a problem you actually don't have...
My second mistake was that I had the same email address in the "From line" as in the "Send test to" field. It is clearly said, that you must not send a test mail to an address not in the list, but I could not find a hint, that both above fields must not be the same as well...
OK, here is a faster way for you to check what problem your installation might have and how to fix it.
Here are the steps for testing it.
First, make sure it's nothing inside phplist and the problem can be reduced to the connection.
I wrote a script to talk directly over phpmailer without phplist in between. Put this file into the admin/phpmailer/ directory and called e.g. test.php. Navigate to it directly over your browser e.g. http://localhost/phplist/admin/phpmailer/test.php.
If you see an error, it is merely a connection problem. If not, the problem is somewhere else.
- Code: Select all
<php>CharSet = "utf-8";
$mail->IsSMTP();
$mail->Host = $mail_host;
$mail->Username = $mail_username;
$mail->Password = $mail_password;
$mail->SMTPAuth = true;
$mail->From = "you1@yourdomain.com";
$mail->FromName = "Test - your name";
$mail->AddAddress("you2@yourdomain2.com","Service");
$mail->Subject = "Testmail";
$mail->IsHTML(true);
$mail->Body = "<html><head><title>test</title><head><body><b>testmail</b></body></html>";
$mail->AltBody = "alternativ als text";
if( ! $mail->Send())
{
echo "Problem: ";
echo $mail->ErrorInfo;
}else{
echo "gesendet";
}
?>
It's a connection problem, what now?
Check your firewall settings. First just disable the firewall and test it again. If it goes through, it's a firewall problem, see step 3. If it does not go through (even the firewall is down) than it is a problem with your connection. Can you send email over you standard email client? Are server and username, password etc the same? Check these basics things.
4. OK, It's the firewall
You have to permit two forms of communication, inbound and outbound.
At your side the server (e.g. Apache.exe) needs to establish an outbound connection (Port 53 UDP).
The the remote SMTP server needs to talk back on Port 25.
Check if both forms of connection are allowed. I am very careful with my web server. So I permit single ports on for single addresses.
However, better check out if the SMTP server talks back from a different address. For checking you can see the logs. It's not always the same name (or IP). E.g. I connected via Apache port 53 with mail.domain_1.com and the SMTP Server talked back from mail.domain_2.com on port 25.
ALL THESE ports and addresses need to be permitted to allow this communication.
I am using Norton Internet Security and the log viewer (Firewall log) is very handy. Use it together with the option "monitor". You can do this by manually create rules for Apache.exe. Put on top of it a monitor rule which allows almost everything. This way you can find out what's going on.
5. check your “From line”
AGAIN: DO NOT use the same address for "from" and for "send test message to ...".
In fact, do not use an address which appears anywhere else in the mail list for
check this too
Don’t forget to have a look at admin/defaultconfig.inc!
There are constant email addresses like the following and other setups.
listreports@[DOMAIN]
noreply@[DOMAIN]
6. In version 2.10.5 the table phplist_user_blacklist_data doesn't exist
read more:
http://forums.phplist.com/viewtopic.php?p=33737#33737
However, be careful with the first line, this is all about a not existing table, what makes no sense to drop. If you have the table already, make sure you don't drop your valuable black list!
AND, I am using the engine InnoDB with utf8, you might want to change this as well.
Here the statement which works for me:
DROP TABLE IF EXISTS `YOUR DBNAME`.`phplist_user_blacklist_data`;
CREATE TABLE `YOUR DBNAME`.`phplist_user_blacklist_data` (
`email` varchar(255) NOT NULL default '',
`name` varchar(100) default NULL,
`data` text,
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
[/b]