Skip to content

berry.email.EMail

Nikos Siatras edited this page Oct 3, 2022 · 3 revisions

Description

 public function __construct(string $charset = "UTF-8")

EMail class represents a simple e-mail message.

Example

require_once(__DIR__ . "/berry/email.php"); // Include berry email package

$htmlContent = '<h1>Email Title</h1>';
$htmlContent .= '<div>Dear customer, this is Elon Musk...</div>';

$email = new EMail();
$email->setSenderAddress("[email protected]");
$email->setSenderName("Elon Musk");
$email->setSubject("This is a test");
$email->setHTMLContent($htmlContent);
$email->setRecipientAddress("[email protected]");

// Send the email
if ($email->Send())
{
    print "Email sent!";
}
else
{
    print "Unable to send the email!";
}