Hello to all, first time poster...
I am an intermediate php programmer. I have developed a site that will distribute certificates that are emailed to the user at the end of the site visit. I use Pear mine email to send an html version of the certificate. Until recently, the CSS for the mime attachment was inline, but then I switched the CSS to a style tag that was appended to the begining of the table's html code. Everything worked for a bit, and now it doesn't.
Does anyone have any experience with sending CSS information for Html Mime email for PHP. For now I am going to go back to the inline declarations, but I would rather send a seperate CSS attachment (tried this, couldn't get it to work) with the email.
Thanks in advance for any help.
PHP Mime Email and CSS
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Some clients don't deal with CSS very well when it's not embedded inline. For the most solid solution I would personally just bite the bullet and sprinkle your code with the CSS directly.
EDIT | "Some clients" includes Thunderbird too (last I tried)
EDIT 2|
EDIT | "Some clients" includes Thunderbird too (last I tried)
EDIT 2|
Using Swift:but I would rather send a seperate CSS attachment (tried this, couldn't get it to work) with the email
Code: Select all
$css = new Swift_Message_EmbeddedFile(new Swift_File("/path/to/css_file.css"));
$message->attach(new Swift_Message_Part(
"<html><head>
<link rel=\"stylesheet\" href=\"" . $message->attach($css) . "\" />
etc etc etc
", "text/html"));