1. Go to this page and download the library: Download websitesql/mailer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Create a mail provider instance
$mailer = new \WebsiteSQL\Mailer\MailProvider($mailConfig);
// Example 1: Send HTML email
$mailer->html('<h1>Hello World</h1><p>This is a test email.</p>')
->subject('Test HTML Email')
->send('[email protected]');
// Example 2: Send plain text email
$mailer->plain('Hello World. This is a test email.')
->subject('Test Plain Text Email')
->send('[email protected]');
// Example 3: Send email with both HTML and plain text
$mailer->html('<h1>Hello World</h1><p>This is a test email.</p>')
->plain('Hello World. This is a test email.')
->subject('Test Multipart Email')
->send('[email protected]');
// Example 4: Use a template
$mailer->template('welcome', ['name' => 'John Doe'])
->subject('Welcome to Our Site')
->send('[email protected]');