Activity — Mail service

(no submission)

Purpose: Hands-on experience with PHPMailer, practice form handling, sending email using PHPMailer library via Gmail
Requirements:

Please refer to PHP mail service for details on setting up and sending email using PHPMailer library via Gmail SMTP.

For this activity, you may work alone or with another student in this course. There are two options. Please do at least one.


Option 1: Library Notification

(PHP, JSON and file processing, mail service)

Imagine you are implementing a notification system for webPL Library. (Alternatively, you may use any library's name of your choice) Write a PHP program to

  1. Read borrow_records.json, which contains information about books that have been borrowed from webPL Library (or your library).

    Feel free to modify the JSON data, include additional records, update the borrowers' email addresses.

  2. Determine if the book is overdue. You may assume that each book can be borrowed for 14 days. If the book is overdue, construct an email notification. You decide on the email content and format. The content should be customized and included at least the following information:
    • Borrower's name
    • Book title(s)
    • Due date
    Your program then uses PHPMailer to construct and send an email notification to the borrower's email address. Be sure to include a proper email's subject.
Optional:

Feel free to modify the notification the way you like, or add additional content you feel should be included. Get creative and have fun!


Option 2: Contact Us

(PHP, form handling, mail service)

Imagine you are creating a contact us form. You may use the solution from the CSS and Bootstrap activity as a starting point, or you may create a contact us form from scratch. Alternatively, you may create a contact form you plan to used for your project. Save your form in .html or .php depending on your implementation.

The contact us form should accept (at least):

You will write a PHP program to retrieve the form data entry. Your program then uses PHPMailer to construct and send an email to webpl.uva@gmail.com or someone (you decide — please do not send to the course instructor). The email should include the form data entry. Your program may also send a copy of the email to the recipient's email address.

You decide which inputs are required. Include client-side and / or server-side input validation as appropriate.

You may modify your interface the way you like. Get creative. Feel free to add additional elements you feel should be included and have fun!


To deploy and test your program use one of the following options: