✅ Prerequisites
- • PHP 7.4+ with IMAP extension
- • Access to email account (Gmail recommended)
- • Cron access for scheduling
- • Blog system already configured
1 Check PHP IMAP Extension
If not installed:
Ubuntu/Debian:
CentOS/RHEL:
Windows (XAMPP):
- 1. Open
php.ini - 2. Find
;extension=imap - 3. Remove the
;to uncomment - 4. Restart Apache
2 Configure Email Account
Option A: Gmail (Recommended)
1. Enable IMAP
- • Go to Gmail Settings → Forwarding and POP/IMAP
- • Enable IMAP
- • Save changes
2. Create App Password
- • Go to Google Account Security
- • Enable 2-Factor Authentication (if not already)
- • Go to "App Passwords"
- • Select "Mail" and your device
- • Copy the 16-character password
3. Update .env file
Option B: Office 365
Option C: Custom Domain / cPanel
3 Create Required Directories
4 Test the System
Run manually to test:
Check the output for any errors. You should see:
5 Setup Cron Job
Make the script executable:
Edit crontab:
Add one of these lines:
Every 30 minutes (recommended):
Every 15 minutes (more frequent):
Every hour:
Save and exit. Verify cron is set:
6 Enable Blogger Permissions
Make sure at least one user has blogger privileges:
7 Send Test Email
To: blogs@yourdomain.com
Subject: Test Blog Post
Body:
Wait 30 minutes (or however long your cron interval is)
Then check:
- • Logs:
tail -f logs/email-to-blog.log - • Blog admin:
https://morsetrainerpro.com/blog-admin.html
🔍 Quick Troubleshooting
Error: "Cannot connect to mailbox"
Solution:
- 1. Verify IMAP is enabled in email settings
- 2. Check firewall allows outbound port 993
- 3. Verify credentials in
.env - 4. For Gmail, use App Password (not regular password)
Error: "PHP Fatal error: Call to undefined function imap_open"
Solution: IMAP extension not installed
Images not uploading
Solution:
📊 Monitoring
View Logs
Admin Interface
Access the monitoring dashboard:
Features:
- • View recent logs
- • Run processor manually
- • Check system status
- • Clear old logs
🎉 You're Done!
Your email-to-blog system is now operational!
Next Steps:
- 1. Send your first real blog post
- 2. Monitor logs to ensure it's working
- 3. Add email templates to your email client
- 4. Share the blog email with your team
Happy Blogging! 📝✨