Answers.Body: <p>What fixed or for me was creating a css file and copying the style sheet into that file and referencing it as a external style sheet in the html (instead of having it in the actual email) </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-11T05:52:13.723Z
Answers.LastActivityDate: 2019-11-11T05:52:13.723Z
Answers.UserDisplayName: netzih
Answers.Body: <p>You will need to add your style sheet inside {literal} when adding stylesheet in Message template. For example </p>
  
  <pre><code>{literal}
  &lt;style&gt;
   your code
  &lt;/style&gt;
  {/literal}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-29T01:15:35.897Z
Answers.Text: Maybe I'm doing something wrong but I'm just getting {literal}{/literal} in my email message now.
Answers.UserDisplayName: netzih
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-29T01:23:51.747Z
Answers.Text: I was wondering if civimail only works with CSS inline?
Answers.UserDisplayName: netzih
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-29T03:13:41.920Z
Answers.Text: Try adding the setting in civicrm.setting.php described here https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#smarty
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-30T17:01:31.103Z
Answers.Text: @Demerit I think that's something totally different. Smarty is enavled and used but that does not have to do with this AFAIK.
Answers.UserDisplayName: netzih
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-29T00:19:01.707Z
Answers.LastActivityDate: 2019-06-29T00:19:01.707Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>Trying to use my own custom html e-mail in CiviMail with custom CSS in it (specifically to optimize on mobile).
  When I have the CSS stylesheet info on top I cannot send a test email or preview in HTML. when I click either of them I get Error
  "Sorry an error occurred and your information was not saved"
  How can I get around this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T20:08:41.937Z
Comments.Text: I am still having this issue on WordPress
   the error I'm getting in the chrome console is "POST https://www.example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/ajax/rest 500"jquery.min.js?r=p6mna:4 
  Anyone know what this can be? or how to fix it?
Comments.UserDisplayName: netzih
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-04T20:15:02.410Z
Comments.Text: When testing the same Email on Drupal I did not have that error
Comments.UserDisplayName: netzih
Tags: <civimail><css>
Title: When adding CSS in civimail (under source) getting an error when trying to see or send test
ThreadText: # When adding CSS in civimail (under source) getting an error when trying to see or send test
  
  (Asked by: username_0 on 2019-06-29)
  
  Trying to use my own custom html e-mail in CiviMail with custom CSS in it (specifically to optimize on mobile).
  When I have the CSS stylesheet info on top I cannot send a test email or preview in HTML. when I click either of them I get Error
  "Sorry an error occurred and your information was not saved"
  How can I get around this?
  
  **Tags:** civimail, css
  
  > **Comments:**
  > **username_0**: I am still having this issue on WordPress  the error I'm getting in the chrome console is "POST https://www.example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm/ajax/rest 500"jquery.min.js?r=p6mna:4  Anyone know what this can be? or how to fix it?  
  > **username_0**: When testing the same Email on Drupal I did not have that error  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2019-11-11. Score: 0 | Accepted answer
  
  What fixed or for me was creating a css file and copying the style sheet into that file and referencing it as a external style sheet in the html (instead of having it in the actual email)
  
  
  ---
  
  ### Answer by username_1 on 2019-06-29. Score: 2
  
  You will need to add your style sheet inside {literal} when adding stylesheet in Message template. For example 
  {literal}
  
  {/literal}
  
  > **Comments:**
  > **username_0**: Maybe I'm doing something wrong but I'm just getting {literal}{/literal} in my email message now.  
  > **username_0**: I was wondering if civimail only works with CSS inline?  
  > **username_2**: Try adding the setting in civicrm.setting.php described here https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#smarty  
  > **username_0**: @username_2 I think that's something totally different. Smarty is enavled and used but that does not have to do with this AFAIK.  
  
  ---
  
  