{"id":2026198,"date":"2011-04-11T11:11:14","date_gmt":"2011-04-11T11:11:14","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/php-mail-problem\/"},"modified":"2016-08-19T23:34:11","modified_gmt":"2016-08-19T23:34:11","slug":"php-mail-problem","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/php-mail-problem\/","title":{"rendered":"PHP Mail Problem"},"content":{"rendered":"<p>I am using PHP mail functionality to send mail whenever a user submits the feedback on a post.<\/p>\n<p>The codes are something like this :<br \/>\n&lt;?php<br \/>\n$headers = &#8216;From: automated_message@somedomain.com&#8217;.&#8221;\\r\\n&#8221; .<br \/>\n           &#8216;CC: abc@somedomain.com&#8217;.&#8221;\\r\\n&#8221;.<br \/>\n           &#8216;Reply-To:$_REQUEST[&#8216;contactemail&#8217;]&#8217;.&#8221;\\r\\n&#8221;;<\/p>\n<p>if ($_REQUEST[&#8216;contactemail&#8217;]){<br \/>\nmail($to, &#8216;Response to somedomain.com Ad&#8217;, $body.$editlink,$headers);<br \/>\nmail($_REQUEST[&#8216;contactemail&#8217;], &#8216;Response to somedomain.com Ad&#8217;, $client_tag.$body, $headers);<br \/>\n}else{<br \/>\necho'&lt;h2&gt;You seem to have entered an invalid e-mail address.  Please try again.&#8217;;<br \/>\n}<br \/>\n?&gt;<\/p>\n<p>When i am using email address in Reply-To: someeamilid@somedomain.com it works but when i use $_REQUEST[&#8216;contactemail&#8217;] , it gives an error which is as follows: Parse error: syntax error, unexpected T_STRING in runtime.php(42):eval()\u2019d code on line 24.<\/p>\n<p>LIne 24 is: $headers = &#8216;From: automated_message@somedomain.com&#8217;.&#8221;\\r\\n&#8221; .<br \/>\n           &#8216;CC: abc@somedomain.com&#8217;.&#8221;\\r\\n&#8221;.<br \/>\n           &#8216;Reply-To:$_REQUEST[&#8216;contactemail&#8217;]&#8217;.&#8221;\\r\\n&#8221;;<\/p>\n<p>Please suggest how o resolve this issue.<\/p>\n<p>Thanks<br \/>\nDipak<\/p>\n","protected":false},"template":"","class_list":["post-2026198","topic","type-topic","status-closed","hentry","topic-tag-parse-error","topic-tag-php-mail"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2026198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/2026198\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=2026198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}