Skip to content

PHP Email Verification & XKCD Comic Subscription System

Notifications You must be signed in to change notification settings

NikunjRajpara/XKCD-Comic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

XKCD Comic Email Subscription System πŸ“¬

A PHP-based web application that allows users to register their email, verify it with a 6-digit code, and receive a random XKCD comic via email. The system includes an unsubscribe feature, and all emails are sent using Gmail SMTP. User data is stored in a simple text file β€” no database is used.


✨ Features

  • πŸ“§ Email registration and verification
  • πŸ”‘ 6-digit email verification code system
  • πŸ“¨ Sends random XKCD comics to verified users
  • πŸ”— Unsubscribe via email verification
  • πŸ—‚οΈ Email storage using registered_emails.txt

βš™οΈ How It Works

  1. User submits their email via a form.
  2. A 6-digit verification code is emailed via Gmail SMTP.
  3. On successful verification, the email is saved to registered_emails.txt.
  4. send_xkcd.php (can be run manually or with CRON) fetches a random XKCD comic and emails it to all verified users.
  5. Each email includes an unsubscribe link. Clicking it triggers a confirmation process.

πŸ”§ Tech Stack

  • PHP
  • Gmail SMTP (for sending HTML emails)
  • HTML (for formatting)
  • XKCD API (for fetching comic data)

πŸ›  Setup Instructions

  1. Clone the repo:

    git clone https://github.com/NikunjRajpara/XKCD-Comic.git
    cd XKCD-Comic
  2. Configure your Gmail SMTP credentials in functions.php.

  3. Host the src/ folder on a PHP-supported server (e.g. XAMPP)

  4. To send comics manually, run:

bash php src/send_xkcd.php


πŸ“© Made with ❀️ by Nikunj Rajpara


πŸ“œ License This project is open-source and available under the MIT License.

About

PHP Email Verification & XKCD Comic Subscription System

Topics

Resources

Stars

Watchers

Forks