0

I use PHPMailer to submit automated e-mails. Style I added in the message isn't working at all.

Here's an example:

$message .= '<p style="font-family:"Sans Serif";font-size:22px">Merci d’avoir utilisé les services de gestion de projet de, nous apprécions votre confiance. Votre facture est disponible en cliquant sur lien ci-dessous:</p>';

Sans Serif isn't used, nor is font-size, etc.

Anthony
  • 27
  • 7
  • This is most likely a result of the mail client rather than your code. If this is the case then there's not much you can do serverside. How did you determine it "isn't working"? – symcbean Aug 04 '16 at 17:41
  • You already posted this http://stackoverflow.com/q/38725173/ – Funk Forty Niner Aug 04 '16 at 17:41
  • I did, but the other post was locked and I couldn't answer - and the post you marked as duplicate wasn't even the same errors. – Anthony Aug 04 '16 at 17:56

2 Answers2

2

You're writing broken HTML:

$message .= '<p style="font-family:"Sans Serif";font-size:22px">[..snip...]
                      ^--start attribute
                                   ^---end attribute

So Sans is seen as some new/unknown HTML attribute, NOT as the name of a font.

Something more like this would work:

$message .= '<p style="font-family:\'Sans Serif\';font-size:22px">

Note the \'.

Marc B
  • 356,200
  • 43
  • 426
  • 500
0

Take Sans Serif out of the double quotes.

coderodour
  • 1,072
  • 8
  • 16