php - Can't send form with special characters character
<p>I'm working on a contact form for my website and I'm trying to make the user submit their email and name through an HTML form. My form has a reCaptcha and here is the <code>action</code> file:</p>

<pre><code>&lt;?php
    if(isset($_POST['submit']) &amp;&amp; !empty($_POST['submit'])):
        if(isset($_POST['g-recaptcha-response']) &amp;&amp; !empty($_POST['g-recaptcha-response'])):
            // Your site secret key
            $secret = 'my_secret_key';
            // Remote user address
            $ip = $_SERVER["REMOTE_ADDR"];
            // Get verify response data
            $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $secret . '&amp;response=' . $_POST['g-recaptcha-response']);
            $responseData = json_decode($verifyResponse);
            if($responseData-&gt;success):
                // Contact form submission code
                $email = htmlentities(!empty($_POST['email'])?$_POST['email']:'');

                $to = 'myemail@gmail.com';
                $subject = 'A new email from ' . $email;
                $htmlContent = '&lt;p&gt;&lt;a href="mailto:' . $email . '"&gt;' . $email . '&lt;/a&gt;&lt;/p&gt;';

                // Always set content-type when sending HTML email
                $headers = "MIME-Version: 1.0" . "\r\n";
                $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
                // More headers
                $headers .= 'From: User &lt;' . $email . '&gt;' . "\r\n";
                // Send email
                @mail($to, $subject, $htmlContent, $headers);
                @mail($email, $subject, $htmlContent, $headers);
            endif;
        endif;
    endif;
?&gt;
</code></pre>

<p>So if the user submits an @ (at) in their email field, the email never gets sent. I suspect it could be because of the above code. Are there any kind of restrictions to which characters can be sent/accepted by <code>mail</code>? And if so why? I tried sending a message like this:</p>

<p>адгтф~`!#$%^&amp;*()_-+=&lt;,>.?/:;"'\|{}[]</p>

<p>And it never got to my email-box. Help would be really appreciated!</p>