EmailSender with Newsletter

Introduction

This application allows users to send unlimited emails. The emails can be imported from a file, added manually by these users or via the newsletter subscription form. All you need is your own dedicated server or hosting service. The application requires PHP and MySQL so it is cheap and easy to use.

More Information

  1. Installation
  2. Usage
  3. Development
  4. Upgrade
  5. Change Logs

1. Installation

Server Requirements

This application requires PHP 8.x and MySQL 5.x-8.x. No knowledge of any framework is required. The application uses json and mod_rewrite. It uses cron jobs as well. The exec() function cannot be blocked by your hosting provider. You need to make sure that your hosting service meets these requirements.

Hosting Configuration

Set the root directory of the php files to "public". Set the path for your hosting:

<path to project>/public

Create a database with full user permissions. Use the database name as in your config:

for example: "emailsender"

Application Configuration

Change the settings in the "database.php" file. Set as in the "database.php.dist" file (check "config"):

'db_host' => 'localhost'
'db_port' => 3306
'db_user' => '<user>'
'db_password' => '<password>'
'db_database' => 'emailsender'

If necessary, set these permissions. Change the permissions of the "options.php" file to 666:

<path to project>/config/options.php

Change the permissions of the directories to 777:

<path to project>/cron
<path to project>/data/Export
<path to project>/data/Import

Application Installation

Install the application by running the "install.php" file. Open the url below in your browser:

https://emailsender.<domain.com>/install.php

Run this web application in your browser. Open the url below:

https://emailsender.<domain.com>

Check if your hosting allows you to use exec() for Cron. The Cron class uses the exec() function to send emails. For example, it looks like below:

exec('crontab ' . $cronFile);

Check the "Send" menu option. If your email sending starts without errors, everything is fine.

2. Usage

Using this application is very simple. You need to add a list, then add emails to that list. The emails can be imported from a file. You can add them manually. Subscribers' emails can also be added via the newsletter form. Then add some text and use the "Send" option from the app menu... See the menu descriptions below.

Register

You need to add one administrator after installation. This admin can add more users. Account activation is required. You must click the activation link in your email.

Log In

After successful activation, you can log in to the application. Enter your login or email and password.

Reset Password

You can reset your password. For this purpose, enter your login or email. Then click the link in your email. A page will open where you must enter a new password.

Users

On this page, the app administrators can add and delete users.

Log Out

Click this menu option to log out.

Home

The home page shows an example of using the newsletter subscription form.

Options

On this page you can find various app options. These options are:

Lists

On this page you can add and delete email lists.

Emails

You can view your emails here. First select a list. Then you can search for a specific email address. The email list allows you to delete any of them.

Insert

Select any list where you want to add an email address. Then add the owner's name and the email itself.

Export

Select your email list. Now you can export your emails to a file.

Import

Here you can import emails from a file to any selected list.

Write

Enter a subject and message. When you're done, save your text. This text will appear in the list below. You can edit and delete any texts from this list. Editing itself is like writing. Press "Save" to finish.

Send

You can run one email sending at a time. To do this, select an email list. Select a text subject. Press "Send" to start sending your emails. To start a new email sending, stop the current one first. Your email sending stops automatically when it's finished. You can also end it manually. To do this, press the "Stop" button.

3. Development

The easiest way is to use Docker Desktop to develop this software. To do so, proceed as shown below.

Go to the application directory:

cd <path to project>

Start the application stack defined in docker-compose.yml:

docker-compose up -d

Set the permissions and access for the php-apache container:

docker exec -it php-apache bash
cd /var/www/html/config
ls -l
chmod 666 /var/www/html/config/options.php
chown -R www-data:www-data /var/www/html/config/options.php
ls -l
exit

Open this web application and/or phpMyAdmin in your browser:

http://localhost:8000
http://localhost:8001

Stop the application stack:

docker-compose down

4. Upgrade

Updating is very simple. Delete old files and upload new ones. Set as for installation (see Application Configuration). Upgrade the application by running the "install.php" file. Open the url below in your browser:

https://emailsender.<domain.com>/install.php

Your database will be automatically configured.

5. Change Logs

v1.0.1 - 13 June 2023

- Fix: Standard License changed

v1.0.0 - 29 May 2023

- Initial Release