CSS inliner magic isn't applied for emails with attachments
Closed this issue · 5 comments
Hi guys,
When sending email with attachments (using regular attach() method):
Mail::send('emails.reminder', ['user' => $user], function ($m) use ($user) {
$m->to('myself@example.org', 'Me')->subject('Your Files!');
$m->attach('/tmp/anyfile');
});
The letter looks good in desktop mail, but wrong in gmail (which relies on inline styles).
Then I've dug that you're applying cssinliner only for cases when email Content-type is "text/html" or "multipart/alternative". While in above example the resulting email has "multipart/mixed".
Are you ignoring it by intention? Let me know why. Otherwise, please consider merging my PR.
Thanks.
+1
running into this issue as well, emails look good unless you use attach or attachData then they look broken.
Sorry for the delay.
#45 is merged, so if you are running the dev-master it should work now.
Thanks!
Why cant i attach emails with snowfire?
If i do ->attach(), i get an error, Unable to open file for reading [1511521470.docx] please am begging, help me out!
$beautymail = app()->make(Beautymail::class);
$beautymail->send('mails.custom', ['data' => $data], function($message) use ($data) {
$message
->from($data['from'])
->to($data['email'], $data['name'])
->attach($data['file'])
->subject(request('subject'));
});
@InspiredPrynce try to pass full path to file into $data['file']
e.g. "/var/www/1511521470.docx"