September 23, 2013 6:01 am

How to Send Nice HTML Email with PHP

If you are making an email software then you must know how to make email templates and send with proper headers in stylish format not a plain email with only text. In PHP with mail() function you can send a simple email but but there is some headers which make it more flexible you can attached files format it in HTML and many more. I am going to explain you how to make an HTML email and give you a demo and script to download.

how-to-send-nice-html-email-wit- php

Send HTML email with PHP needs same method as normal email.

To send HTML email you have to add headers which is optional by default where we pass Content-Type type declaration telling mail services that parse this email as HTML.

The headers give us lots of important functions to our emails like file attachment, content type etc.

Use HTML tags for design

Now your emails look nicer this email is directly coming to you in formatted style to be easy to eyes.

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.

Tutorial Categories:
  • Lawl

    Is this a serious article? This is so so bad…

    • huzoorbux

      @e6bdecd96835a47645760f21d22281a4:disqus what is bad in it?

      • Krunal Bhingradiya

        Everything is bad…. tell me what is g00d? @huzoorbux:disqus

        • huzoorbux

          ok @92ffeca1ad5be857bbbc4878f572ff21:disqus i will make good articles next time.

  • Krunal Bhingradiya

    demo is working but when we download source code… then all are fake… don’t use it… fake demo

    • huzoorbux

      @92ffeca1ad5be857bbbc4878f572ff21:disqus what is wrong in source code it is the same code which is in demo site.


    This is awesome šŸ™‚

  • jhay

    sir i didnt receive in my email the sample in your demo .. why is it?

    • stalin

      use mail() function, it will work

  • Anuj Gupta

    Not working.
    I tried to send myself an email using your demo but it doesn’t work.

    • huzoorbux

      Demo will not send email download script and test it on your website.

  • Satyendra Yadav

    thank u bhai

    • Arya

      Are koi yeh sab tho chalta rahta hai………..

  • Prashant

    With this code i can not send email in msg its show me blank mail