-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
Dude this library is sending the emails in spam. Find the code below -
$mailService = $this->getServiceLocator()->get('goaliomailservice_message');
$content = new MimeMessage();
$htmlPart = new MimePart("Please find attached this report received from a " . $clientName . " user.
Regards,
" . $this->zfcUserAuthentication()->getIdentity()->getDisplayName() . "
");
$htmlPart->type = 'text/html';
$textPart = new MimePart("Please find attached this report received from a " . $clientName . " user.
Regards,
" . $this->zfcUserAuthentication()->getIdentity()->getDisplayName());
$textPart->type = 'text/plain';
$content->setParts(array($textPart, $htmlPart));
$contentPart = new MimePart($content->generateMessage());
$contentPart->type = 'multipart/alternative;' . PHP_EOL . ' boundary="' . $content->getMime()->boundary() . '"';
$attachment = new MimePart(fopen($pdfPath, 'r'));
$attachment->type = 'application/pdf';
$attachment->filename = 'report' . time() . '.pdf';
$attachment->encoding = Mime::ENCODING_BASE64;
$attachment->disposition = Mime::DISPOSITION_ATTACHMENT;
$body = new MimeMessage();
$body->setParts(array($contentPart, $attachment));
$message = new Message();
$message->setEncoding('utf-8')
->addTo($email)
->addFrom(array($this->getLoggedInUserAdminFromEmail() => $this->getLoggedInUserAdminContactName()))
->setSubject($this->getLoggedInUserAdminContactName().' Report')
->setBody($body);
try {
$mailService->send($message);
} catch (\Exception $e) {
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
