Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Sending email with PHP: from Basic to Advanced
Rating: 4.8 out of 5(297 ratings)
2,022 students

Sending email with PHP: from Basic to Advanced

Learn how to send emails from your PHP website, including best practices.
Last updated 4/2026
English

What you'll learn

  • Choose the right tool for sending email with PHP
  • Send emails from PHP to multiple recipients
  • Send emails from PHP containing non-English characters
  • Send emails from PHP containing images and with file attachments
  • Use HTML and CSS in your PHP emails to add formatting and layout
  • Use Composer to manage third-party code packages
  • Create an asynchronous queue from scratch to improve browser response time when sending emails
  • Use the RabbitMQ messaging server to build an asynchronous email solution
  • Use Mailgun to send, track and receive emails

Course content

8 sections45 lectures2h 3m total length
  • Introduction2:34

    Welcome to the course!

    In this lecture we'll look at:

    • A summary of what you're going to learn throughout the course, starting from the basics of sending email through to advanced techniques.
    • How to get the most out of the course: experimenting with the code yourself, where to find the source code and how to get help.
  • Install a Web Server on Your Computer3:03

    In this lecture we'll install a web server locally on your computer. We'll cover:

    • Downloading and installing the software
    • Where to put your PHP files so you can view them in a web browser
    • Checking PHP is working by writing a simple script and viewing it in a browser
  • Change the Root Directory of the Web Server3:28

    In this lecture we'll change the root directory of the web server so we can have code and resources outside of the publicly-accessible web folder. We'll cover:

    • How to make your code more secure by keeping some of it outside the web root
    • Reconfiguring the web server to change the root directory without changing the URL
    • Testing the new configuration


  • Get Access to an SMTP Mail Server2:27

    To follow along with the code, you'll need access to an SMTP mail server. In this lecture you'll learn:

    • What an SMTP mail server is and what it does
    • The data you need to connect to an SMTP server from code
    • Where to get access to a mail server

Requirements

  • You should already be familiar with PHP and HTML.
  • You should be comfortable installing software on your computer - in the first section we'll be installing a web server.
  • You should know the basics of using CSS to add styles to HTML. This course does NOT teach how to use HTML and CSS.

Description

Learn the basic concepts, tools and functions that you will need to send emails from your website or web application in PHP.

Learn to Send emails using PHP in this Comprehensive Course.

  • Learn basic email concepts
  • Discover the best tools and methodologies for sending emails using PHP
  • Learn best practices to make sure your emails arrive as intended
  • Improve response time in the browser by sending emails asynchronously
  • Use third-party email providers to track what happens to emails once sent

Add Sending emails to Your PHP Toolkit

If you’re creating a website or web application in PHP, sooner or later you’ll want it to send emails to your users, for example: 

  • a contact page
  • an account activation email
  • a monthly report
  • an invoice
  • a password reset email
  • a newsletter
  • email marketing

and so on.

Sending email from PHP can be a tricky thing to get right. From making sure that your email is readable in as many different email clients as possible, to sending the email asynchronously so that your website responds as quickly as possible.

This course will teach you the basics through to the advanced techniques and tools used by professional PHP programmers.

Content and Overview

I designed this course to be easily understood by programmers who know PHP, HTML and CSS but don't have much experience sending emails from PHP.

Starting with the basic concepts of how emails work, such as senders, recipients, file attachments, using HTML and CSS and so on, this course will take you through all the steps needed to have your PHP website sending emails to its users.

Once we've covered the basics, we'll move on to advanced techniques like sending emails asynchronously and tracking emails using third-party email services.

New concepts are explained in detail as and when they're introduced, with full explanations of all the code used with detailed examples.

At the end of the course, you will be able to swiftly and reliably send professional-looking emails using PHP.

Complete with working source code at every stage, you'll be able to work alongside the instructor and will receive a verifiable certificate of completion upon finishing the course.

Who this course is for:

  • This PHP email course is for those who already know PHP and who want to learn how to send email from their PHP scripts.
  • This course is NOT for you if you don't already have some basic PHP and HTML knowledge.