I want to make a newsletter email, that I can put HTML codes and send it to the users, are there any functions from PHP that enables HTML in mail()?
Printable View
I want to make a newsletter email, that I can put HTML codes and send it to the users, are there any functions from PHP that enables HTML in mail()?
I consider HTML emails a bad idea. However, you can do them. See Example 1075 from the PHP: mail documentation.
Why it's a bad idea? Like myspace, they have graphic newsletter, which I really like. Isn't that developed using mail with HTML enabled feature?
MySpace.com does not exemplify nor endorse proper web programming techniques.
Yes, you can send HTML emails. No, I don't like them. HTML is for web pages, not emails. Web sites can do content-type negotiation; emails offer no such facility. So if someone reads an HTML email in an email client that doesn't support HTML, they'll get gibberish.
You could argue that "rich" content types are a natural extension of SMTP, but they don't work well enough nor degrade with any sort of grace to really be sensible.
And yes: lots of people do use HTML emails. Most don't realise it (Outlook users...). I still think they're a bad idea.