/**
* Send email
* @param array $to
* @param array $from
* @param string $subject
* @param string $text
* @param bool $use_template
* @return bool
*/
public function send($to, $from, $subject, $text, $use_template = true)
{
$this->client->setFrom($from[1], $from[0]);
$this->client->addAddress($to[1], $to[0]);
$this->client->Subject = $subject;
if ($use_template) {
$template = '
<!DOCTYPE HTML>
<html dir="rtl">
<head>
<meta charset="utf-8">
</head>
<body style="font-family: tahoma, sans-serif !important;">
<div style="font: 13px tahoma,sans-serif !important;direction: rtl;background-color: #e8e8e8;">
<div style="width: 70%;background-color: #fff;background-color: #fff; border-radius: 3px;margin: auto;position: relative;border-left: 1px solid #d9d9d9;border-right: 1px solid #d9d9d9;">
<div style="top: 0;position: absolute;width: 100%; height: 4px;background: url( \'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAECAYAAAD8kH0gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGhJREFUeNpi/P///xkGKFh27TfDkiu/GQiBKC1WhhgdVoLqXkzsZHje30ZQnUR+OYNkYRVWORZkxy0DOo6JgGERpDhuYgcDAxN+EyVyS3E6DgSYkB3HQG3HEQo5Ao4DO3AwOw4EAAIMAMZJM9nl1EbWAAAAAElFTkSuQmCC\' ) repeat;"></div>
<div style="padding: 22px 15px;">
{TEXT}
</div>
<div style="bottom: 0;position: absolute;width: 100%; height: 4px;background: url( \'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAECAYAAAD8kH0gAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGhJREFUeNpi/P///xkGKFh27TfDkiu/GQiBKC1WhhgdVoLqXkzsZHje30ZQnUR+OYNkYRVWORZkxy0DOo6JgGERpDhuYgcDAxN+EyVyS3E6DgSYkB3HQG3HEQo5Ao4DO3AwOw4EAAIMAMZJM9nl1EbWAAAAAElFTkSuQmCC\' ) repeat;"></div>
</div>
</div>
</body>
</html>
';
$msg = str_replace('{TEXT}', $text, $template);
} else {
$msg = $text;
}
$this->client->msgHTML($msg);
return $this->client->send();
}