Guide to PHP and MySQL (University at Buffalo Version)
Chapter 11: Sending Email with PHP
PHPMailer function provides a set of class objects you can ue to send an email message from your web site. To send email, you must have an account on SMTP
(Simple Mail Transfer Protocal) mail server, such as gmail.com.
Using PHPMailer
on your localost Server.
To send email from your localhost
server via a Gmail account, download the latest version of PHPMailer from GitHub (source code (zip)). Extract the PHPMailer.zip
file to your \www\PHPMailer\
folder.
Then you should try sending email. First, copy \www\PHPMailer\examples\gmail.phps
to www\PHPMailer\examples\gmail.php
. Then, edit this gmail.php file and change these values to your gmail account information:
Sending Email with PHPMailer
See the \www\PHPMailer\examples\
for various examples of sending email using PHPMailer.
Using the PHP mail()
function to send email
An easier way to send email is to use the PHP mail() function.