CUTCODEDOWN
Minimalist Semantic Markup

Welcome Guest
Please Login or Register

If you have registered but not recieved your activation e-mail in a reasonable amount of time, or have issues with using the registration form, please use our Contact Form for assistance. Include both your username and the e-mail you tried to register with.

Author Topic: HTML & CSS in Email  (Read 857 times)

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +8/-0
    • Grumpy Young Man
HTML & CSS in Email
« on: 28 Jan 2020, 04:54:29 am »
How do we send HTML in email?

As in, do we have to use "inline" styles?

Also is PHPMailer an suitable third party add on to enable SMTP email sending?
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

Dave

  • Junior Member
  • *
  • Posts: 38
  • Karma: +12/-0
Re: HTML & CSS in Email
« Reply #1 on: 28 Jan 2020, 05:23:51 am »
Safest to use inline styling since a lot of (most) mail clients won't allow external style sheets. PHPMailer is probably the easiest mailer to use out there though there are several available of course.
Dave

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +8/-0
    • Grumpy Young Man
Re: HTML & CSS in Email
« Reply #2 on: 28 Jan 2020, 05:45:46 pm »
Thanks Dave - and welcome to this forum! :)
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

Jason Knight

  • Administrator
  • Hero Member
  • *****
  • Posts: 1049
  • Karma: +188/-1
    • CutCodeDown -- Minimalist Semantic Markup
Re: HTML & CSS in Email
« Reply #3 on: 29 Jan 2020, 11:43:11 am »
Generally I tell clients to avoid HTML e-mails. Many servers (like mine) IGNORE them if they don't have a plaintext fallback (via multipart) for the simple fact no legitimate e-mail I would ever care about has ANY reason to have HTML in it... so automatically they're just spam.

If you HAVE to do it, again send multipart with a plaintext fallback, and stick to HTML 3.2 as if CSS doesn't even exist. Very few of the new HTML 4 tags are supported by all mail clients, CSS is often flat out ignored...

You basically have to dial the clock back to 1997, which is just ANOTHER good reason to not even bother with that nonsense. You want HTML, make a flipping page on your site and send a plaintext with a link.
We are all, we are all, we are all FRIENDS! For today we're all brothers, tonight we're all friends. Our moment of peace in a war that never ends.

GrumpyYoungMan

  • Hero Member
  • *****
  • Posts: 787
  • Karma: +8/-0
    • Grumpy Young Man
Re: HTML & CSS in Email
« Reply #4 on: 29 Jan 2020, 12:24:47 pm »
All I am planning on sending will be confirmation email links and emails if their accounts get locked, forgotten password request and all that kind of thing...? and also warnings if their vehicles are MOTs...
Trying to learn a new trick to prove old dogs can learn new ones...

Total Novice have-a go Amateur Programmer - not sure that is the right thing to say... but trying to learn...

fgm

  • Jr. Member
  • **
  • Posts: 60
  • Karma: +5/-0
Re: HTML & CSS in Email
« Reply #5 on: 7 Feb 2020, 08:19:01 am »
I use mutt and HTML emails are a royal pain in the ass. If you appreciate your business please stick to text. When I have to click a confirmation link my procedure is:

  • Download the damned HTML file from the email
  • Use a text editor looking for text patterns matching confirmation link
  • Extend my terminal window through my two monitors to make sure I can copy the link
  • Copy it in the navigator and then press [Enter]
  • Cross fingers
« Last Edit: 7 Feb 2020, 02:24:37 pm by fgm »

Dave

  • Junior Member
  • *
  • Posts: 38
  • Karma: +12/-0
Re: HTML & CSS in Email
« Reply #6 on: 7 Feb 2020, 03:16:50 pm »
If you must send HTML just make sure that you also include a plain text version too that includes ALL of the same information formatted so that it looks decent.
Dave

 

SMF spam blocked by CleanTalk

Advertisement