nliautaud / p01contact

Create contact forms by writing simple tags. Also a plugin for GetSimple and Pico CMS.
MIT License
16 stars 15 forks source link

SMTP support #50

Open smpcasgit opened 5 years ago

smpcasgit commented 5 years ago

possible to send smtp email?

nliautaud commented 1 year ago

Issues with mail() :

Core advantages of mail libraries :

Disadvantages :

See https://github.com/PHPMailer/PHPMailer

Requirements The provided solution need to mitigate the complexity added by the usage of an SMTP setup, support a wide range of users and still work out of the box.

Solution :

Note that the implementation should loads PHPMailer whether installed trough composer or with a provided path to manually copied files. For example switch between

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';

and

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'path/to/PHPMailer/src/Exception.php';
require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php';

or bypassing autoload entirely ?