1. Go to this page and download the library: Download sun/sunmailer 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/ */
sun / sunmailer example snippets
// namespace
use SunMailer\Mailer;
use SunMailer\View;
use SunMailer\MailerException;
$email = '[email protected]';
$name = 'Test mail name';
$subject = 'Test mail subject';
$body = 'Test mail body';
try
{
if(Mailer::send($email, $name, $subject, $body))
{
echo 'Email has been sent successfully.';
}
}
catch (MailerException $e)
{
echo 'Oops!!! Something goes to wrong. '. $e->getMessage();
}
$attached = 'images/sunmailer.jpg';
if(Mailer::send($email, $name, $subject, $body, $attached))
{
echo 'Email has been sent successfully.';
}
View::render('to.path.test');
$body = View::render('email.test');
if(Mailer::send($email, $name, $subject, $body))
{
echo 'Email has been sent successfully.';
}
// to get configuration file
Helper::config();
// to get root directory path
Helper::root_path();
// to get log directory path
Helper::log_path();
// to get temp directory path
Helper::temp_path();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.