Code: Select all
<?
$xml = "<?xml version=\"1.0\"?>\n";
$xml .= "<?ADF version=\"1.0\"?>\n";
$xml .= "<adf>\n";
$xml .= "<prospect>\n";
$xml .= "<requestdate>2005-03-22T18:28:28-00:00</requestdate>\n";
$xml .= "<vehicle interest=\"buy\" status=\"used\">\n";
$xml .= "<year>2005</year>\n";
$xml .= "<make>Hummer</make>\n";
$xml .= "<model>H1</model>\n";
$xml .= "<vin>12345123451234512</vin>\n";
$xml .= "<stock>KRS1</stock>\n";
$xml .= "<trim></trim>\n";
$xml .= "<doors</doors>\n";
$xml .= "<bodystyle>Motorcycle</bodystyle>\n";
$xml .= "<transmission</transmission>\n";
$xml .= "<odometer status=\"unknown\" units=\"mi\">0</odometer>\n";
$xml .= "<colorcombination>\n";
$xml .= "<interiorcolor></interiorcolor>\n";
$xml .= "<exteriorcolor></exteriorcolor>\n";
$xml .= "<preference>1</preference>\n";
$xml .= "</colorcombination>\n";
$xml .= "<price type=\"quote\" currency=\"USD\">$0</price>\n";
$xml .= "<option>\n";
$xml .= "<optionname>AM/FM/Cass/CD</optionname>\n";
$xml .= "<weighting</weighting>\n";
$xml .= "</option>\n";
$xml .= "<option>\n";
$xml .= "<optionname>Active Handling</optionname>\n";
$xml .= "<weighting</weighting>\n";
$xml .= "</option>\n";
$xml .= "<option>\n";
$xml .= "<optionname>Adjustable Pedals</optionname>\n";
$xml .= "<weighting</weighting>\n";
$xml .= "</option>\n";
$xml .= "<option>\n";
$xml .= "<optionname>Air Conditioning</optionname>\n";
$xml .= "<weighting</weighting>\n";
$xml .= "</option>\n";
$xml .= "<option>\n";
$xml .= "<optionname>Alloy Wheels</optionname>\n";
$xml .= "<weighting</weighting>\n";
$xml .= "</option>\n";
$xml .= "<comments></comments>\n";
$xml .= "</vehicle>\n";
$xml .= "<customer>\n";
$xml .= "<contact>\n";
$xml .= "<name part=\"first\">TestFirst</name>\n";
$xml .= "<name part=\"last\">TestLast</name>\n";
$xml .= "<email>support@ourdealerwebsite.com</email>\n";
$xml .= "<phone type=\"voice\" time=\"day\"></phone>\n";
$xml .= "<phone type=\"voice\" time=\"evening\">802-658-0965</phone>\n";
$xml .= "<address>\n";
$xml .= "<street line=\"1\"></street>\n";
$xml .= "<street line=\"2\"></street>\n";
$xml .= "<city></city>\n";
$xml .= "<regioncode</regioncode>\n";
$xml .= "<postalcode</postalcode>\n";
$xml .= "<country</country>\n";
$xml .= "</address>\n";
$xml .= "</contact>\n";
$xml .= "<comments>Test time</comments>\n";
$xml .= "</customer>\n";
$xml .= "<vendor>\n";
$xml .= "<id source=\"ourdealerwebsite.com\"</id>\n";
$xml .= "<vendorname>DDC Support Training</vendorname>\n";
$xml .= "<contact>\n";
$xml .= "<name part=\"first\"></name>\n";
$xml .= "<name part=\"last\"></name>\n";
$xml .= "<email>support@ourdealerwebsite.com</email>\n";
$xml .= "<phone type=\"voice\" time=\"day\">555-555-5555</phone>\n";
$xml .= "<phone type=\"voice\" time=\"evening\"></phone>\n";
$xml .= "<address>\n";
$xml .= "<street line=\"1\">1313 Mockingbird Lane</street>\n";
$xml .= "<street line=\"2\"></street>\n";
$xml .= "<city>Burlington</city>\n";
$xml .= "<regioncode>VT</regioncode>\n";
$xml .= "<postalcode</postalcode>\n";
$xml .= "<country>UNITED STATES</country>\n";
$xml .= "</address>\n";
$xml .= "</contact>\n";
$xml .= "</vendor>\n";
$xml .= "<provider>\n";
$xml .= "<name part=\"full\">ourdealerwebsite.com</name>\n";
$xml .= "<service>Test Drive - ourdealerwebsite.com</service>\n";
$xml .= "<url>http://www.ourdealerwebsite.com</url>\n";
$xml .= "<email>support@ourdealerwebsite.com</email>\n";
$xml .= "<phone type=\"voice\">802-658-0965 x102</phone>\n";
$xml .= "<contact>\n";
$xml .= "<name part=\"full\">ourdealerwebsite.com Support</name>\n";
$xml .= "<email>support@ourdealerwebsite.com</email>\n";
$xml .= "<phone type=\"voice\" time=\"day\">802-658-0965 x102</phone>\n";
$xml .= "<address>\n";
$xml .= "<street line=\"1\">431 Pine Street</street>\n";
$xml .= "<city>Burlington</city>\n";
$xml .= "<regioncode>VT</regioncode>\n";
$xml .= "<postalcode>05401</postalcode>\n";
$xml .= "<country>US</country>\n";
$xml .= "</address>\n";
$xml .= "</contact>\n";
$xml .= "</provider>\n";
$xml .= "</prospect>\n";
$xml .= "</adf>\n";
// CREATE THE MESSAGE FROM THE XML STUFF AND THE BUFFERED ADF STUFF
$to = "leademail@ourdealerwebsite.com"; // this is where the leads are sent to
$subject = "New Lead From ME - TESTING";
$headers = "xml version: 1.0" . "\r\n";
$headers .= "Content-Type: application/xhtml+xml; encoding=ISO-8859-1" . "\r\n";
$mail_sent = @mail($to, $subject, $xml, $headers);
echo $mail_sent ? '<font color="#ff0000">Form data sent successfully to CRM Tool!</font>' : '<font color="#ff0000">Auto lead failed - message not sent!</font>';
?>
Any help would be much appreciated!