
Mailtrap with symfony, testing emails has never been so easy
Luigi Laezza
5 minutes
Mailtrap is a fake SMTP server for development teams to test, view and share emails sent from the development and staging environments without spamming real customers.
Symfony 2.0 uses SwiftmailerBundle to send emails. You can find more information on how to send email on Symfony's website. To get started you need to modify app/config/config.yml and add the following: swiftmailer: spool: { type: memory } transport: smtp host: mailtrap.io username: xxxxxx password: xxxxxx auth_mode: cram-md5 port: 2525
You can configure WordPress SMTP by using this code: function mailtrap($phpmailer) { $phpmailer->isSMTP(); $phpmailer->Host = 'mailtrap.io'; $phpmailer->SMTPAuth = true; $phpmailer->Port = 2525; $phpmailer->Username = 'xxxxx'; $phpmailer->Password = 'xxxxx'; } add_action('phpmailer_init', 'mailtrap');
Now every email sent out from your application will be “trapped” by Mailtrap for your convenience, without the need of creating tons of test emails.
Related Articles

How AI and Automation Can Transform Your Business framework
By Luigi Laezza

Checkboxes vs. Radio Buttons: Simplifying User Interaction in Web Forms framework
By Luigi Laezza

Enhancing Your Writing Efficiency: Avoiding Verbose Pitfalls framework
By Luigi Laezza

Harnessing Events: The Core of Every Graphical Application framework
By Luigi Laezza

Outsourcing von Softwareentwicklung: Vorteile für Unternehmen framework
By Luigi Laezza

Maximizing User Experience: The Key to Success in Graphical Application Development framework
By Luigi Laezza

Filtering User Input: Safeguarding Your Textbox from Unwanted Characters framework
By Luigi Laezza

Unlocking the Potential of No-Code and Low-Code Platforms for Entrepreneurs framework
By Luigi Laezza