PHPlist on Windows NET server

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

PHPlist on Windows NET server

Postby ImproperUser » 6:44pm, Wed 16 Jan, 2013

Yesterday, I installed PHPlist for a site on a Windows/NET server hosted by Arvixe. I will post about a few ways I tweaked the settings that worked well for me.


First of all, be mindful that on shared hosting, Arvixe has a limit of 400 emails per hour, to avoid hogging of server resources. Your host may allow more, or less.

Create an email address for sending the emails such as news@yourdomain.ext. Create a new email address for receiving list email bounces (mail undeliverable), such as listbounces@yourdomain.ext

From your control panel, create a MySQL database user and database for your list.

Edit the PHPlist config.php file.

Lines 20 - 44 are for your database settings.

On line 72, uncomment and fill in your list bounce address:
$message_envelope = 'listbounces@yourdomain.ext';

On line 85, here at Arvixe, fill in as follows (your host may be different):
$bounce_mailbox_host = 'mail.yourdomain.ext';

On line 97 leave as is (your host may be different):
$bounce_mailbox_port = "110/pop3/notls";

Line 107-- I set it to 1 so that PHPlist can process list bounces and purge the listbounce inbox:
$bounce_mailbox_purge =1;

Line 132 shows you the default login credentials for installation of PHPlist:
# default login is "admin" with password "phplist"
After you go through installation, you will be prompted to reset the password.

Line 158 - I recommend setting JUMPOFF to 1 because you should make it absolutely EASY for people to unsubscribe:
# if a user should immediately be unsubscribed, when using their personal URL, instead of
# the default way, which will ask them for a reason, set this to 1
define("UNSUBSCRIBE_JUMPOFF",1);

Change line 197 to 0 or PHPlist will not send any emails:
define ("TEST",0);

Line 217 - set to false if you don't want the admin address to receive reports after each queue run (I left it true):
define('SEND_QUEUE_PROCESSING_REPORT',true);

Lines 259 to 290 - I set all of these to 1 - do as you like.

Line 355 IMPORTANT for how many emails will be processed in a single run:
define("MAILQUEUE_BATCH_SIZE",25);
I experimented with different settings and settled on 25.

Line 347 IMPORTANT:
define("MAILQUEUE_BATCH_PERIOD",300);
3600 is an hour. If I did the math correctly then 300 should represent 5 minutes. So, the settings are for a max of 25 emails to be sent each 5 minutes. This means a max of 300 emails per hour, which is well under the Arvixe required max of 400 for shared hosting. This setting works well for me.

Line 354 - I set to 3 seconds. More did not seem to work very well, and I did not think less was enough.
define('MAILQUEUE_THROTTLE',3);

Lines 392 - 500 I left on the defaults, did not change.

I did not change the default settings so that attachments would be possible. To use PHPlist to send attachments might consume too much shared server resources. It is better to just put a link to files in the email.

Line 699:
define("PHPMAILER",1);

Line 703:
define("PHPMAILERHOST",'yourdomain.ext');

Lines 707 - 708 for the email sender address you set up (not the same as list bounces address):
$phpmailer_smtpuser = 'news@yourdomain.ext';
$phpmailer_smtppassword = 'emailpassword';

Line 715 - for Windows server I found it worked best to hard code the path as such:
$tmpdir = 'C:\HostingSpaces\username\yourdomain.ext\wwwroot\lists\tmp';
You will need to make that folder and its files writable from your control panel. Make sure to place an index.php file in that folder.

Into each folder of PHPlist that does not have an index.php file, place an index.php file like the one below (because Windows does not use .htaccess):
<?php
header('Location: http://yourdomain.ext/');
?>
For security, from your site control panel, make sure you have directory browse turned OFF. Make sure you have index.php set as one of the acceptable default folder files.

If you import emails to PHPlist to seed your list, make absolutely certain these are people you already have an existing relationship with! This is absolutely essential, to avoid spam accusations. Some people will take utter delight in accusing you of spam even if unjustified, and this will cause you no end of trouble. You could lose your site even if you've done nothing wrong, so be extra super careful.

Your first email to your list should be a message to explain:
1. They are receiving the message because they have an existing relationship with you.
2. What their existing relationship is: they bought a product from you, attended your seminar, whatever.
3. You are asking their permission to send them occasional messages about your products and services.
4. If they do not want to receive your messages, they can click the unsubscribe link below, or they can reply to the email with "UNSUBSCRIBE" in the subject.
5. Include an apology for any inconvenience your message may have caused.

For automated sending and bounce processing, leaving the PHPlist running in the browser does not work well for lists of more than a few dozen addresses because your browser may poop out, etc. Instead, make a PHP file like the following and save as processqueue.php -- or better yet, give it a random file name that would be difficult for someone to guess.
<?php
//this script found on the PHPlist website

function process_queue() {
//variables
$domain = "http://yourdomain.ext/lists/";
$post_data["page"] = "processqueue";
$post_data["login"] = "loginid";
$post_data["password"] = "loginpassword";
$url = $domain . "admin/index.php";

//open connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);

//clean up
curl_close($ch);

return $result;
}
//echo "OK";
$result = process_queue();

?>

Make another PHP file named processbounces.php or a random hard to guess file name:
<?php
//script found on PHPlist website
function process_bounces() {
//variables
$domain = "http://yourdomain.ext/lists/";
$post_data["page"] = "processbounces";
$post_data["login"] = "loginid";
$post_data["password"] = "loginpassword";
$url = $domain . "admin/index.php";

//open connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);

//clean up
curl_close($ch);

return $result;
}
//echo "OK";
$result = process_bounces();

?>

PHPlist is primarily for Linux servers, although it runs on Windows. Therefore, it is set up to work with cron, but of course, we don't have cron on Windows. What we do have on Arvixe Windows, in the control panel, is "Scheduled Tasks." Your host may be different.

In Scheduled Tasks, select "Check site availability." For "Response status = to" type in 200. That means the page loaded okay. For the url to load, type in the web address of your PHP process queue file:
http://yourdomain.ext/lists/admin/processqueue.php

You can leave access username and password blank. Put in the email address to receive reports of scheduled task.

For schedule, choose interval -- I chose every 30 minutes, so PHPlist will send 25 emails from the queue every 30 minutes -- well within the Arvixe shared hosting limit. (If there are no emails left to send, no mail will be sent.) I set max execution time to 15 minutes.

Repeat scheduled task setup for processbounces.php -- you may want to set that one to be run only twice a day.
ImproperUser
phpList newbie
 
Posts: 1
Joined: 6:37pm, Wed 16 Jan, 2013

Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest