{"id":2250,"date":"2019-11-29T00:00:00","date_gmt":"2019-11-29T00:00:00","guid":{"rendered":"https:\/\/www.mailboxvalidator.com\/resources3\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/"},"modified":"2026-07-29T02:25:37","modified_gmt":"2026-07-29T02:25:37","password":"","slug":"how-to-use-mailboxvalidator-symfony-bundle-to-validate-email","status":"publish","type":"docs","link":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/","title":{"rendered":"How to use MailboxValidator Symfony Bundle to validate email?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><figure><a href=\"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-post-mid wp-image-1078\" src=\"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-600x300.png\" alt=\"How-to-use-MailboxValidator-Symfony-Bundle-to-validate-email\" width=\"600\" height=\"300\" srcset=\"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-600x300.png 600w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-300x150.png 300w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-1024x512.png 1024w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-768x384.png 768w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-50x25.png 50w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-920x460.png 920w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-320x160.png 320w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7.png 1200w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The MailboxValidator Symfony Email Validation Bundle is an easy-to-use Symfony package that enables Symfony users to validate email addresses with just a few lines of code. This package uses the MailboxValidator API to perform the validation, so you will need to sign up for a <a href=\"https:\/\/www.mailboxvalidator.com\/plans#api\" target=\"_blank\" rel=\"noreferrer noopener\">FREE API key<\/a> and you are good to go.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Dependencies<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This bundle requires Symfony 4.3 to work. The MailboxValidator PHP Module is also required and will be auto installed by Composer. In case your Composer did not install it for you, you can get it from here: <a href=\"https:\/\/github.com\/MailboxValidator\/mailboxvalidator-php\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/MailboxValidator\/mailboxvalidator-php<\/a> .<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have the API key, the next step is to install the package by using Composer. Open your terminal, navigate to your project root directory and type the following command:<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-35d430d3\"\n     id=\"betterdocs-code-snippet-35d430d3\"\n     data-language=\"bash\"\n     data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n            <div class=\"betterdocs-file-info\">\n                \n                            <\/div>\n        <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n                            <div class=\"betterdocs-code-snippet-copy-container\">\n                    <button class=\"betterdocs-code-snippet-copy-button\"\n                            type=\"button\"\n                            data-clipboard-target=\"#betterdocs-code-snippet-35d430d3 .betterdocs-code-snippet-code code\"\n                            aria-label=\"Copy code to clipboard\">\n                        <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                        <\/svg>\n                    <\/button>\n                                    <\/div>\n                    <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n        \n        <pre class=\"betterdocs-code-snippet-code language-bash\"><code>composer require mailboxvalidator\/mailboxvalidator-bundle<\/code><\/pre>\n    <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-35d430d3');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">Composer will then install the bundle into your web application. After that, load a <em>.env<\/em> file in your PHP application via <code class=\"EnlighterJSRAW\" data-enlighter-language=\"php\">Dotenv::load()<\/code>.<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-66012cba\"\n     id=\"betterdocs-code-snippet-66012cba\"\n     data-language=\"php\"\n     data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n            <div class=\"betterdocs-file-info\">\n                                    <div class=\"betterdocs-file-icon\">\n                                                    <span class=\"betterdocs-file-icon-emoji\">\ud83d\udc18<\/span>\n                                            <\/div>\n                \n                            <\/div>\n        <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n                            <div class=\"betterdocs-code-snippet-copy-container\">\n                    <button class=\"betterdocs-code-snippet-copy-button\"\n                            type=\"button\"\n                            data-clipboard-target=\"#betterdocs-code-snippet-66012cba .betterdocs-code-snippet-code code\"\n                            aria-label=\"Copy code to clipboard\">\n                        <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                        <\/svg>\n                    <\/button>\n                                    <\/div>\n                    <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n        \n        <pre class=\"betterdocs-code-snippet-code language-php\"><code>use SymfonyComponentDotenvDotenv;\n\n$dotenv = new Dotenv();\n\n$dotenv-&gt;load(__DIR__.&#039;\/.env&#039;); \/\/Your .env file path<\/code><\/pre>\n    <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-66012cba');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">Then, open your <em>.env<\/em> file and add the following line:<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-5d205eab\"\n     id=\"betterdocs-code-snippet-5d205eab\"\n     data-language=\"bash\"\n     data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n            <div class=\"betterdocs-file-info\">\n                \n                            <\/div>\n        <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n                            <div class=\"betterdocs-code-snippet-copy-container\">\n                    <button class=\"betterdocs-code-snippet-copy-button\"\n                            type=\"button\"\n                            data-clipboard-target=\"#betterdocs-code-snippet-5d205eab .betterdocs-code-snippet-code code\"\n                            aria-label=\"Copy code to clipboard\">\n                        <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                        <\/svg>\n                    <\/button>\n                                    <\/div>\n                    <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n        \n        <pre class=\"betterdocs-code-snippet-code language-bash\"><code>MBV_API_KEY=PASTE_YOUR_API_KEY_HERE<\/code><\/pre>\n    <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-5d205eab');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Usage<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To use any one of the three validators or to use all of the validators, include the following lines in any form controllers that handle validations:<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-aca0ce73\"\n     id=\"betterdocs-code-snippet-aca0ce73\"\n     data-language=\"php\"\n     data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n            <div class=\"betterdocs-file-info\">\n                \n                            <\/div>\n        <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n                            <div class=\"betterdocs-code-snippet-copy-container\">\n                    <button class=\"betterdocs-code-snippet-copy-button\"\n                            type=\"button\"\n                            data-clipboard-target=\"#betterdocs-code-snippet-aca0ce73 .betterdocs-code-snippet-code code\"\n                            aria-label=\"Copy code to clipboard\">\n                        <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                        <\/svg>\n                    <\/button>\n                                    <\/div>\n                    <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n        \n        <pre class=\"betterdocs-code-snippet-code language-php\"><code>use MailboxValidatorBundleValidatorMBVSingle;\n\nuse MailboxValidatorBundleValidatorMBVDisposable;\n\nuse MailboxValidatorBundleValidatorMBVFree;<\/code><\/pre>\n    <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-aca0ce73');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">After that, add a new rule to your form field and edit the error message. For example, if you want to validate the disposable email, your rule will be like this:<\/p>\n\n\n\n<div class=\"betterdocs-code-snippet-wrapper theme-light betterdocs-code-snippet-9176d4d2\"\n     id=\"betterdocs-code-snippet-9176d4d2\"\n     data-language=\"php\"\n     data-copy-button=\"true\">\n\n            <div class=\"betterdocs-code-snippet-header betterdocs-file-preview-header\">\n        <div class=\"betterdocs-file-preview-left\">\n                            <div class=\"betterdocs-traffic-lights\">\n                    <span class=\"traffic-light traffic-light-red\"><\/span>\n                    <span class=\"traffic-light traffic-light-yellow\"><\/span>\n                    <span class=\"traffic-light traffic-light-green\"><\/span>\n                <\/div>\n            \n            <div class=\"betterdocs-file-info\">\n                                    <div class=\"betterdocs-file-icon\">\n                                                    <span class=\"betterdocs-file-icon-emoji\">\ud83d\udc18<\/span>\n                                            <\/div>\n                \n                            <\/div>\n        <\/div>\n\n        <div class=\"betterdocs-file-preview-right\">\n                            <div class=\"betterdocs-code-snippet-copy-container\">\n                    <button class=\"betterdocs-code-snippet-copy-button\"\n                            type=\"button\"\n                            data-clipboard-target=\"#betterdocs-code-snippet-9176d4d2 .betterdocs-code-snippet-code code\"\n                            aria-label=\"Copy code to clipboard\">\n                        <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <path d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z\" fill=\"currentColor\"\/>\n                        <\/svg>\n                    <\/button>\n                                    <\/div>\n                    <\/div>\n        <\/div>\n    \n    <div class=\"betterdocs-code-snippet-content\">\n        \n        <pre class=\"betterdocs-code-snippet-code language-php\"><code>-&gt;add(&#039;email&#039;, EmailType::class, [\n\n    &#039;constraints&#039; =&gt; [\n\n        new MBVDisposable([\n\n            \/\/You can also customize your own message. For example,\n\n            \/\/&#039;message&#039; =&gt; &#039;This email is disposable. Please enter another email again.&#039;,\n\n        ]),\n\n    ],\n\n])<\/code><\/pre>\n    <\/div>\n<\/div>\n\n<script type=\"text\/javascript\">\ndocument.addEventListener('DOMContentLoaded', function() {\n    \/\/ Initialize copy functionality for this specific snippet\n    const snippet = document.getElementById('betterdocs-code-snippet-9176d4d2');\n    if (snippet && window.BetterDocsCodeSnippet) {\n        window.BetterDocsCodeSnippet.initCopyButton(snippet);\n    }\n});\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\">The bundle provides three different validation methods: disposable, single and free. <strong>Single Validation<\/strong> will validate the email address based on several factors, such as whether the email address contains high risk keywords or whether the email address is in our blacklist. <strong>Disposable Validation<\/strong> will validate whether the email address belongs to a disposable email service provider or not. <strong>Free Validation<\/strong> will validate whether the email address belongs to a free email service provider or not.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you can try to open your form and enter a disposable email address. The validator should return an error message once the submit button is clicked.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><a href=\"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"944\" height=\"524\" src=\"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1.png\" alt=\"Example outcome if user entered disposable email address during registration.\" class=\"wp-image-1006\" srcset=\"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1.png 944w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1-300x167.png 300w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1-768x426.png 768w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1-50x28.png 50w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1-920x511.png 920w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1-600x333.png 600w, https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2019\/11\/mbv_symfony1-320x178.png 320w\" sizes=\"auto, (max-width: 944px) 100vw, 944px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center m-bottom-5\">Get started with MailboxValidator<\/h2>\n\n\n\n<p class=\"has-text-align-center m-bottom-5 is-size-20 wp-block-paragraph\">Improve your email deliverability and sender reputation in email marketing.<\/p>\n\n\n\n<p class=\"has-text-align-center m-bottom-5 is-size-20 wp-block-paragraph\">Register today and clean your email lists for <strong>FREE<\/strong>!<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><a class=\"maxbutton-1 maxbutton maxbutton-sign-up-bulk-trial\" target=\"_blank\" title=\"No Setup Fee. Sign Up Trial Today!\" rel=\"noopener\" href=\"https:\/\/www.mailboxvalidator.com\/plans#mailboxvalidator-freesignup\"><span class='mb-text'>GET STARTED FOR FREE<\/span><\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>Overview The MailboxValidator Symfony Email Validation Bundle is an easy-to-use Symfony package that enables Symfony users to validate email addresses [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"doc_category":[67,69],"doc_tag":[],"class_list":["post-2250","docs","type-docs","status-publish","hentry","doc_category-mailboxvalidator-articles","doc_category-technical-articles"],"year_month":"2026-08","word_count":347,"total_views":"4","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"mbv_editor","author_nicename":"mbv_editor","author_url":"https:\/\/www.mailboxvalidator.com\/resources\/author\/mbv_editor\/"},"doc_category_info":[{"term_name":"MailboxValidator Articles","term_url":"https:\/\/www.mailboxvalidator.com\/resources\/article-categories\/mailboxvalidator-articles\/"},{"term_name":"Technical Articles","term_url":"https:\/\/www.mailboxvalidator.com\/resources\/article-categories\/technical-articles\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to use MailboxValidator Symfony Bundle to validate email? -<\/title>\n<meta name=\"description\" content=\"Use MailboxValidator Symfony Bundle to validate email easily, especially during form registration and processing.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use MailboxValidator Symfony Bundle to validate email? -\" \/>\n<meta property=\"og:description\" content=\"Use MailboxValidator Symfony Bundle to validate email easily, especially during form registration and processing.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/mailboxvalidator\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-29T02:25:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@MailBoxV\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/\",\"url\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/\",\"name\":\"How to use MailboxValidator Symfony Bundle to validate email? -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/mbv_articles_img7-600x300.png\",\"datePublished\":\"2019-11-29T00:00:00+00:00\",\"dateModified\":\"2026-07-29T02:25:37+00:00\",\"description\":\"Use MailboxValidator Symfony Bundle to validate email easily, especially during form registration and processing.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/mbv_articles_img7.png\",\"contentUrl\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/mbv_articles_img7.png\",\"width\":1200,\"height\":600,\"caption\":\"How-to-use-MailboxValidator-Symfony-Bundle-to-validate-email\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Knowledge Base\",\"item\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/articles\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to use MailboxValidator Symfony Bundle to validate email?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/#website\",\"url\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/\",\"name\":\"MailboxValidator Articles\",\"description\":\"MailboxValidator Articles\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/#organization\",\"name\":\"MailboxValidator\",\"url\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/cropped-mailboxvalidator-fb-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/wp-content\\\/uploads\\\/2017\\\/11\\\/cropped-mailboxvalidator-fb-logo.png\",\"width\":1199,\"height\":399,\"caption\":\"MailboxValidator\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mailboxvalidator.com\\\/resources\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/mailboxvalidator\",\"https:\\\/\\\/x.com\\\/MailBoxV\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/mailboxvalidator\\\/\",\"https:\\\/\\\/www.pinterest.com\\\/mailboxvalidator\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCesIP5V7nXRXthaqdjjfCFg\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use MailboxValidator Symfony Bundle to validate email? -","description":"Use MailboxValidator Symfony Bundle to validate email easily, especially during form registration and processing.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/","og_locale":"en_US","og_type":"article","og_title":"How to use MailboxValidator Symfony Bundle to validate email? -","og_description":"Use MailboxValidator Symfony Bundle to validate email easily, especially during form registration and processing.","og_url":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/","article_publisher":"https:\/\/www.facebook.com\/mailboxvalidator","article_modified_time":"2026-07-29T02:25:37+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@MailBoxV","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/","url":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/","name":"How to use MailboxValidator Symfony Bundle to validate email? -","isPartOf":{"@id":"https:\/\/www.mailboxvalidator.com\/resources\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/#primaryimage"},"image":{"@id":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7-600x300.png","datePublished":"2019-11-29T00:00:00+00:00","dateModified":"2026-07-29T02:25:37+00:00","description":"Use MailboxValidator Symfony Bundle to validate email easily, especially during form registration and processing.","breadcrumb":{"@id":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/#primaryimage","url":"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7.png","contentUrl":"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2020\/01\/mbv_articles_img7.png","width":1200,"height":600,"caption":"How-to-use-MailboxValidator-Symfony-Bundle-to-validate-email"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/how-to-use-mailboxvalidator-symfony-bundle-to-validate-email\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mailboxvalidator.com\/resources\/"},{"@type":"ListItem","position":2,"name":"Knowledge Base","item":"https:\/\/www.mailboxvalidator.com\/resources\/articles\/"},{"@type":"ListItem","position":3,"name":"How to use MailboxValidator Symfony Bundle to validate email?"}]},{"@type":"WebSite","@id":"https:\/\/www.mailboxvalidator.com\/resources\/#website","url":"https:\/\/www.mailboxvalidator.com\/resources\/","name":"MailboxValidator Articles","description":"MailboxValidator Articles","publisher":{"@id":"https:\/\/www.mailboxvalidator.com\/resources\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mailboxvalidator.com\/resources\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mailboxvalidator.com\/resources\/#organization","name":"MailboxValidator","url":"https:\/\/www.mailboxvalidator.com\/resources\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mailboxvalidator.com\/resources\/#\/schema\/logo\/image\/","url":"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2017\/11\/cropped-mailboxvalidator-fb-logo.png","contentUrl":"https:\/\/www.mailboxvalidator.com\/resources\/wp-content\/uploads\/2017\/11\/cropped-mailboxvalidator-fb-logo.png","width":1199,"height":399,"caption":"MailboxValidator"},"image":{"@id":"https:\/\/www.mailboxvalidator.com\/resources\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/mailboxvalidator","https:\/\/x.com\/MailBoxV","https:\/\/www.linkedin.com\/company\/mailboxvalidator\/","https:\/\/www.pinterest.com\/mailboxvalidator\/","https:\/\/www.youtube.com\/channel\/UCesIP5V7nXRXthaqdjjfCFg"]}]}},"_links":{"self":[{"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/docs\/2250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/comments?post=2250"}],"version-history":[{"count":1,"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/docs\/2250\/revisions"}],"predecessor-version":[{"id":2470,"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/docs\/2250\/revisions\/2470"}],"wp:attachment":[{"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/media?parent=2250"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/doc_category?post=2250"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.mailboxvalidator.com\/resources\/wp-json\/wp\/v2\/doc_tag?post=2250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}