Mail Script | Temp
小叽资源

Mail Script | Temp

/* Inbox Sidebar */ .inbox-sidebar { width: 35%; background: #fff; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; }

// Start auto-generating random emails every 20-45 seconds for current email let intervalId = null; function startAutoGenerateEmails() { if (intervalId) clearInterval(intervalId); if (!currentEmail) return; // generate first email after 5 seconds for demo setTimeout(() => { if (currentEmail) generateRandomIncomingEmail(currentEmail); }, 5000); intervalId = setInterval(() => { if (currentEmail) { generateRandomIncomingEmail(currentEmail); // subtle browser notification if allowed if (Notification.permission === "granted") { new Notification("New email received!", { body: "Check your TempMail inbox" }); } } }, 20000 + Math.random() * 25000); // every 20-45 sec }

// simple escape to avoid XSS function escapeHtml(str) { if (!str) return ''; return str.replace(/[&<>]/g, function(m) { if (m === '&') return '&'; if (m === '<') return '<'; if (m === '>') return '>'; return m; }).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, function(c) { return c; }); } temp mail script

// Get or create a new temp email address function generateNewEmail() { const localPart = randomString(10); const domain = 'tempmail.demo'; // looks like a real temp domain return ${localPart}@${domain} ; }

// Optionally add a welcome email setTimeout(() => { if (currentEmail === newEmailAddr) { addIncomingMessage(currentEmail, "welcome@tempmail.demo", "Welcome to TempMail!", "Hello! This is a temporary email address.\n\nAll incoming messages will appear here.\n\nYou can refresh manually or wait for demo emails.\n\nEnjoy spam-free browsing!"); } }, 1000); } /* Inbox Sidebar */

// Save messages for current email function saveMessagesForEmail(email, messages) { const key = tempmail_${email} ; localStorage.setItem(key, JSON.stringify(messages)); }

.header p { opacity: 0.8; font-size: 0.9rem; } border-right: 1px solid #e2e8f0

.detail-header { padding: 20px; border-bottom: 1px solid #e2e8f0; background: #fefcf5; }