# Bounced email handling

<div class="Y3BBE" data-hveid="CAEQAA" data-processed="true" data-sfc-cp="" id="bkmrk-checking-for-bounced" jsaction="rcuQ6b:&rBFubf_5|npT2md" jscontroller="zcfIf" jsuid="rBFubf_5">Checking for bounced or undelivered emails in PHP requires a multi-step approach, as the built-in `mail()` function only confirms that the email was accepted by the local mail server, not its final delivery status.<span class="uJ19be notranslate" data-wiz-uids="rBFubf_8,rBFubf_9,rBFubf_a"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_8/TKHnVd;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="d844b8a1-9bcf-4c41-b1b6-16ea8a323d60" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIARAB" data-wiz-attrbind="disabled=rBFubf_8/C5gNJc;class=rBFubf_8/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAIQAA" data-processed="true" data-sfc-cp="" id="bkmrk-the-reliable-method-" jsaction="rcuQ6b:&rBFubf_d|npT2md" jscontroller="zcfIf" jsuid="rBFubf_d">The reliable method involves using a **dedicated bounce handling script that connects to a specific mailbox** to retrieve and parse bounce messages sent back by remote mail servers.<span class="uJ19be notranslate" data-wiz-uids="rBFubf_f,rBFubf_g,rBFubf_h"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_f/TKHnVd;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="c092977d-4258-4704-86f2-e290f8900ebc" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIAhAB" data-wiz-attrbind="disabled=rBFubf_f/C5gNJc;class=rBFubf_f/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk-" jsaction="rcuQ6b:&rBFubf_i|npT2md" jscontroller="KHhJQ" jsuid="rBFubf_i">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-method-1%3A-using-a-bo" jscontroller="a7qCn" jsuid="rBFubf_j" role="heading">Method 1: Using a Bounce Handler Script<span class="txxDge notranslate" data-wiz-uids="rBFubf_k,rBFubf_l,rBFubf_m"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_k/TKHnVd;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="ef0b0c87-8b5e-43d9-a499-39c2f7b3157e" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIAxAA" data-wiz-attrbind="disabled=rBFubf_k/C5gNJc;class=rBFubf_k/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAQQAA" data-processed="true" data-sfc-cp="" id="bkmrk-this-approach-involv" jsaction="rcuQ6b:&rBFubf_n|npT2md" jscontroller="zcfIf" jsuid="rBFubf_n">This approach involves setting up a dedicated email address (e.g., `bounce@yourdomain.com`) and then using a PHP script with a mail library to connect to that mailbox, read incoming messages, and identify bounce notifications.<span class="uJ19be notranslate" data-wiz-uids="rBFubf_p,rBFubf_q,rBFubf_r"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_p/TKHnVd;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="15b097b2-b122-448a-9059-4e5f568af7a6" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIBBAB" data-wiz-attrbind="disabled=rBFubf_p/C5gNJc;class=rBFubf_p/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAUQAA" data-processed="true" data-sfc-cp="" id="bkmrk-steps%3A" jsaction="rcuQ6b:&rBFubf_u|npT2md" jscontroller="zcfIf" jsuid="rBFubf_u">**Steps:**<span class="txxDge notranslate" data-wiz-uids="rBFubf_w,rBFubf_x,rBFubf_y"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_w/TKHnVd;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="9a962bc2-cec1-49c5-a793-3b378b527d0b" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIBRAB" data-wiz-attrbind="disabled=rBFubf_w/C5gNJc;class=rBFubf_w/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div>1. <span class="T286Pc" data-sfc-cp="">**Configure a Return Path:** When sending email, specify the `Return-Path` header to point all bounce messages to your dedicated bounce handling address.</span><div class="r1PmQe" data-hveid="CAYQAQ" data-wiz-uids="rBFubf_15,rBFubf_16,rBFubf_17" jscontroller="HP6Sjf" jsuid="rBFubf_14"><div><div class="pHpOfb" data-animation-atomic=""><div class="vVRw1d">php<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0QopQPegQIBhAC"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="rBFubf_18" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" dir="ltr"></div></div></div></div>```
    $to = 'recipient@example.com';
    $subject = 'Test Subject';
    $message = 'Test Message';
    $headers = 'From: webmaster@yourdomain.com' . "\r\n";
    // Important: Set the return path for bounces
    $return_path = '-fbounce@yourdomain.com'; 
    
    // The mail function returns TRUE if accepted by the local MTA, not if delivered
    if (mail($to, $subject, $message, $headers, $return_path)) {
        echo "Email accepted by local MTA, awaiting bounce notifications.\n";
    } else {
        echo "Local server error.\n";
    }
    
    ```
2. <span class="T286Pc" data-sfc-cp="">**Set up a Cron Job:** Create a PHP script to periodically check the `bounce@yourdomain.com` inbox (e.g., every 15 minutes) using an email protocol like IMAP or POP3.</span>
3. <span class="T286Pc" data-sfc-cp="">**Parse Bounce Messages:** The script connects to the inbox and looks for specific keywords or headers (`Final-Recipient`, `status: 5.X.X`, `Mailer-Daemon`, etc.) within the incoming emails to identify the bounced address and the reason for the failure.</span>
4. <span class="T286Pc" data-sfc-cp="">**Log and Act:** Once the bounced email address is identified, your script can log it in a database and take appropriate action (e.g., unsubscribe the address from your mailing list to protect your sender reputation).</span><span class="uJ19be notranslate" data-wiz-uids="rBFubf_1n,rBFubf_1o,rBFubf_1p"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_1n/TKHnVd;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="326dd1f0-d534-4003-9ffb-42812604d2be" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIBhAG" data-wiz-attrbind="disabled=rBFubf_1n/C5gNJc;class=rBFubf_1n/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span>

<div class="Y3BBE" data-hveid="CAcQAA" data-processed="true" data-sfc-cp="" id="bkmrk-a-complete%2C-robust-s" jsaction="rcuQ6b:&rBFubf_1u|npT2md" jscontroller="zcfIf" jsuid="rBFubf_1u">*A complete, robust solution often requires a third-party library to handle the complexities of parsing various bounce formats reliably. You can find examples of such libraries on <span data-sfc-cp="">[GitHub](https://github.com/dyninc/Email-Bounce-PHP)</span> or refer to advanced guides on sites like <span data-sfc-cp="">[Stack Overflow](https://stackoverflow.com/questions/18016589/how-to-find-bounced-or-undelivered-mail-id-using-php)</span>*.<span class="uJ19be notranslate" data-wiz-uids="rBFubf_1y,rBFubf_1z,rBFubf_20"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_1y/TKHnVd;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="782189a3-7954-484c-84a2-39a5587c43f9" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIBxAD" data-wiz-attrbind="disabled=rBFubf_1y/C5gNJc;class=rBFubf_1y/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk--1" jsaction="rcuQ6b:&rBFubf_23|npT2md" jscontroller="KHhJQ" jsuid="rBFubf_23">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-method-2%3A-using-a-th" jscontroller="a7qCn" jsuid="rBFubf_24" role="heading">Method 2: Using a Third-Party Email Service<span class="txxDge notranslate" data-wiz-uids="rBFubf_25,rBFubf_26,rBFubf_27"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_25/TKHnVd;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="bff98cb7-aa88-4e6f-919b-cc64d20c6321" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQICBAA" data-wiz-attrbind="disabled=rBFubf_25/C5gNJc;class=rBFubf_25/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAkQAA" data-processed="true" data-sfc-cp="" id="bkmrk-for-a-more-reliable-" jsaction="rcuQ6b:&rBFubf_28|npT2md" jscontroller="zcfIf" jsuid="rBFubf_28">For a more reliable and less complex solution, many developers use third-party email services (like Postmark, Mailtrap, AWS SES, etc.). These services provide a dedicated API that gives explicit delivery statuses, including bounces, deferred, and opened events, removing the need for you to manage a bounce mailbox and parsing script.<span class="uJ19be notranslate" data-wiz-uids="rBFubf_29,rBFubf_2a,rBFubf_2b"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_29/TKHnVd;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="be8bfcee-90f9-4838-acb9-f8ee746a6345" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQICRAB" data-wiz-attrbind="disabled=rBFubf_29/C5gNJc;class=rBFubf_29/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAoQAA" data-processed="true" data-sfc-cp="" id="bkmrk-this-is-the-recommen" jsaction="rcuQ6b:&rBFubf_2e|npT2md" jscontroller="zcfIf" jsuid="rBFubf_2e">This is the recommended approach for production systems as it is more robust and scalable.<span class="txxDge notranslate" data-wiz-uids="rBFubf_2f,rBFubf_2g,rBFubf_2h"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_2f/TKHnVd;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="16cec610-3f95-4a89-93ad-ce6a6e308896" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIChAB" data-wiz-attrbind="disabled=rBFubf_2f/C5gNJc;class=rBFubf_2f/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk--2" jsaction="rcuQ6b:&rBFubf_2i|npT2md" jscontroller="KHhJQ" jsuid="rBFubf_2i">  
</div><div aria-level="3" class="otQkpb" data-animation-nesting="" data-processed="true" data-sfc-cp="" id="bkmrk-basic-email-validati" jscontroller="a7qCn" jsuid="rBFubf_2j" role="heading">Basic Email Validation (Initial Check)<span class="txxDge notranslate" data-wiz-uids="rBFubf_2k,rBFubf_2l,rBFubf_2m"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_2k/TKHnVd;"><button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="b09d7d3e-84f7-4658-aeda-2b36736e05e5" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQICxAA" data-wiz-attrbind="disabled=rBFubf_2k/C5gNJc;class=rBFubf_2k/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Y3BBE" data-hveid="CAwQAA" data-processed="true" data-sfc-cp="" id="bkmrk-before-sending%2C-you-" jsaction="rcuQ6b:&rBFubf_2n|npT2md" jscontroller="zcfIf" jsuid="rBFubf_2n">Before sending, you can use PHP's built-in functions to check if an email address is at least syntactically correct, which prevents immediate local errors. This does not, however, guarantee the mailbox actually exists.<span class="uJ19be notranslate" data-wiz-uids="rBFubf_2o,rBFubf_2p,rBFubf_2q"><span class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=rBFubf_2o/TKHnVd;"> <button aria-label="View related links" class="rBl3me" data-amic="true" data-icl-uuid="191e0c72-6041-4683-8f93-e4dd7d1ce478" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0Qye0OegQIDBAB" data-wiz-attrbind="disabled=rBFubf_2o/C5gNJc;class=rBFubf_2o/UpSNec;" tabindex="0"><span class="wiMplc ofC0Ud"><svg fill="currentColor" focusable="false" height="12px" viewbox="0 0 24 24" width="12px" xmlns="http://www.w3.org/2000/svg"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></span></button></span></span></div><div class="Fsg96" data-processed="true" data-sfc-cp="" id="bkmrk--3" jsaction="rcuQ6b:&rBFubf_2t|npT2md" jscontroller="KHhJQ" jsuid="rBFubf_2t">  
</div><div class="r1PmQe" data-hveid="CA0QAA" data-processed="true" data-wiz-uids="rBFubf_2v,rBFubf_2w,rBFubf_2x" id="bkmrk-php" jscontroller="HP6Sjf" jsuid="rBFubf_2u"><div><div class="pHpOfb" data-animation-atomic=""><div class="vVRw1d">php<button aria-label="Copy code text to clipboard." class="Ev0C3d" data-ved="2ahUKEwjvn8Dm3tORAxUUxzgGHavbJl0QopQPegQIDRAB"><svg fill="currentColor" height="20px" jscontroller="ZfypCb" jsuid="rBFubf_2y" viewbox="0 -960 960 960" width="20px"><path d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"></path></svg></button></div><div class="pCTyYe" dir="ltr"></div></div></div></div>```
$email = "test@example.com";

if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
    echo "$email is a valid email format.\n";
} else {
    echo "$email is an invalid email format.\n";
}
```