| Current Path : /var/www/html/akm-ar/common/components/ |
| Current File : /var/www/html/akm-ar/common/components/EmailModule.php |
<?php
namespace common\components;
use Yii;
use yii\base\Component;
class EmailModule {
public static function sendemail($emailTo = '', $emailSubject = '', $emailContent = '') {
$output = 'error';
$emailFrom = 'noreply@mylatihan.ros.gov.my';
$email_content2 = '<html>
<body>
<div style="font-family: \'Century Gothic\', CenturyGothic, AppleGothic, sans-serif; font-size: 14px;background-color:rgb(234,234,234);padding:2em 0;">
<div style="width:70%;background-color:white;margin:0 auto;padding:5em;border:1px solid #ccc;border-radius:5px;">
' . $emailContent . '
</div>
</div>
</body>
</html>';
if (!empty($emailTo)) {
$sendemail = Yii::$app->mailer->compose()
->setFrom($emailFrom)
->setTo($emailTo)
->setSubject($emailSubject)
->setHtmlBody($email_content2)
->send();
if ($sendemail)
$output = 'success';
}
return $output;
}
}