I'm having an issue mail()ing XML in the ADF format to my CRM tool.
In a nutshell, ADF stands for Auto-Lead Data Format (http://www.autojini.com/ADF1_0.pdf) and is XML based and used by many auto dealer CRMs.
The XML will work when sent as an email from Gmail over to the CRM tool, but when I actually email it using PHP, it's not recognizing it correctly and I'm not getting the customers information (besides their phone number) nor is the correct service provider showing.
I've been working on this for about 30 hours now and I can't figure it out.
I'd really appreciate your help!!
<?php error_reporting(E_ALL); ini_set('display_errors', 1); $fname=strip_tags($_GET['fname']); $lname=strip_tags($_GET['lname']); $email=strip_tags($_GET['email']); $phone=strip_tags($_GET['phone']); $isodate=date("Y-m-d\TH:i:sP"); $adf = <<<ADF <?xml version = "1.0"?>\n <?adf version="1.0"?>\n <adf>\n <prospect>\n <id sequence="1" source="XXXXXXXXX">360</id>\n <customer>\n <contact>\n <name part="first">Eleadtester</name>\n <name part="last">Jedimaster</name>\n <email preferredcontact="1"></email>\n <phone type="voice">1112225555</phone>\n </contact>\n <timeframe>2 weeks</timeframe>\n </customer>\n <vendor>\n <vendorname>XXXXXXXXXXX</vendorname>\n <contact>\n <name part="full">XXXXXXXXXXXX</name>\n <phone type="voice">111-123-1234</phone>\n <address>\n <street line="1">orange way</street>\n <city>my town</city>\n <regioncode>XX</regioncode>\n <postalcode>XXX03</postalcode>\n <country>USA</country>\n </address>\n </contact>\n </vendor>\n <provider>\n <name part="full">XXXXXXXXXX</name>\n <service>XXXXXXXXXXXX</service>\n </provider>\n </prospect>\n </adf>\n </adf> ADF; $headers = "Content-Type: application/xhtml+xml; charset=ISO-8859-1" . "\r\n"; // encoding=ISO-8859-1 $headers .= 'Content-Transfer-Encoding: 7bit' . "\r\n\r\n"; mail("XXXXXXXXXXX@eleadtrack.net","XXX Lead - $isodate",$adf,$headers); header("Location: apply.html"); ?>
On the CRM side, once this is transferred over and received, in place of the customer name I have "<?adf" in the first name field and last name is empty/"noname".
Thanks for your help,