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.
- π§ 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
- User submits their email via a form.
- A 6-digit verification code is emailed via Gmail SMTP.
- On successful verification, the email is saved to
registered_emails.txt. send_xkcd.php(can be run manually or with CRON) fetches a random XKCD comic and emails it to all verified users.- Each email includes an unsubscribe link. Clicking it triggers a confirmation process.
- PHP
- Gmail SMTP (for sending HTML emails)
- HTML (for formatting)
- XKCD API (for fetching comic data)
-
Clone the repo:
git clone https://github.com/NikunjRajpara/XKCD-Comic.git cd XKCD-Comic -
Configure your Gmail SMTP credentials in functions.php.
-
Host the src/ folder on a PHP-supported server (e.g. XAMPP)
-
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.