Test email functionality with Yasumu’s built-in catch-all SMTP server
Yasumu includes a built-in catch-all SMTP server that makes testing email functionality effortless. Instead of configuring external email services or dealing with spam filters, you can capture and inspect all emails sent from your application directly within Yasumu.
The SMTP server listens on this port. Yasumu automatically assigns an available port when the workspace is created.Configure your application to send emails to localhost:<port>.
Username
Optional SMTP authentication username. Leave empty if authentication is not required.
Password
Optional SMTP authentication password. Set to null or empty string to disable authentication.
To send emails to Yasumu’s SMTP server, configure your application with these settings:
Node.js (Nodemailer)
Python (smtplib)
PHP (PHPMailer)
Environment Variables
const nodemailer = require('nodemailer');const transporter = nodemailer.createTransport({ host: 'localhost', port: 50611, // Use the port from your smtp.ysl secure: false, auth: { user: '', // Leave empty if no auth pass: '', // Leave empty if no auth },});// Send an emailawait transporter.sendMail({ from: '[email protected]', to: '[email protected]', subject: 'Test Email', text: 'Hello from my app!', html: '<p>Hello from my app!</p>',});
import smtplibfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipart# Create messagemsg = MIMEMultipart('alternative')msg['Subject'] = 'Test Email'msg['From'] = '[email protected]'msg['To'] = '[email protected]'# Add contenttext = 'Hello from my app!'html = '<p>Hello from my app!</p>'msg.attach(MIMEText(text, 'plain'))msg.attach(MIMEText(html, 'html'))# Send emailwith smtplib.SMTP('localhost', 50611) as server: server.send_message(msg)
<?phpuse PHPMailer\PHPMailer\PHPMailer;$mail = new PHPMailer(true);// SMTP settings$mail->isSMTP();$mail->Host = 'localhost';$mail->Port = 50611;$mail->SMTPAuth = false;// Email content$mail->setFrom('[email protected]');$mail->addAddress('[email protected]');$mail->Subject = 'Test Email';$mail->Body = '<p>Hello from my app!</p>';$mail->AltBody = 'Hello from my app!';$mail->isHTML(true);$mail->send();?>
Most frameworks support email configuration via environment variables:
Use the Email module API to manage SMTP settings programmatically:
import { EmailModule } from '@yasumu/core';// Get current SMTP portconst port = await workspace.emails.getSmtpPort();console.log('SMTP server running on port:', port);// Get complete configurationconst config = await workspace.emails.getSmtpConfig();console.log('SMTP config:', config);