Comments (3)
Hey,
as there are also a couple issues open with the ZF update from 2.2 to 2.3 I guess I will take some time this week to fix the open stuff.
It would be quite helpful if you could post a little code so I can test sending HTML mails?
from goaliomailservice.
Hi,
The code I use for creating and sending an HTML message is simple:
$mailService = $this->getServiceManager()->get('goaliomailservice_message');
$message = $mailService->createHtmlMessage(
$from,
$to,
$subject,
$emailTemplate,
array(
'data' => $data
)
);
$mailService->send($message);
and the sent e-mail is rendered as plain text in the e-mail clients. I have tried to add this line just before sending the e-mail:
$message->getHeaders()->get('content-type')->setType('multipart/alternative');
which is mentioned as workaround in the above ZF2 issues, but it didn't help. The email is rendered as attachment with name "noname" in the clients and this attachment is empty.
from goaliomailservice.
Hi again,
When I create multipart e-mail with only one HTML part, the e-mail is rendered properly. Here is the code:
$mailService = $this->getServiceManager()->get('goaliomailservice_message');
$html = $mailService->getRenderer()->render(
$emailTemplate,
array(
'data' => $data
)
);
$htmlPart = new MimePart($html);
$htmlPart->type = "text/html; charset=UTF-8";
$htmlPart->encoding = Mime::ENCODING_QUOTEDPRINTABLE;
$body = new MimeMessage();
$body->setParts(array($htmlPart));
$message = new Message();
$message->setFrom($from, $fromName)
->setEncoding('utf-8')
->setSubject($subject)
->setBody($body)
->setTo($to);
$mailService->send($message);
Hope this helps and I it will be really great if the module is fixed soon and multipart messages are rendered properly.
from goaliomailservice.
Related Issues (16)
- instance for goaliomailservice_message fails. HOT 5
- End of line characters
- Default From Email Address HOT 1
- Readme Edit - change options key to transport_options HOT 3
- latest version is no longer compatible with ZF 2.2 HOT 3
- configuration file are incorrect
- Mail attachment support HOT 5
- Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (GoalioMailService) could not be initialized. HOT 3
- zendframework 2.4 compatibility HOT 2
- Problem with accents in text plain mail
- zf3 support
- Mail is going to spam
- Success message, but no email has been sent.
- SMTP setup instructions HOT 3
- fhdfh
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goaliomailservice.