Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "26":{
- "adUrl":"http://www.parseme.vacau.com/index.php?page=search&sCategory=26",
- "title":"Engineering Geologist Figueres",
- "salary":"2300.00 Euro u20ac",
- "category":"ENGINEERING - ARCHITECTURE",
- "publishedDate":"2013-05-07",
- "modifiedDate":"2013-05-27",
- "country":"Spain",
- "region":"Girona",
- "city":"Figueres",
- "cityArea":"Vilatenim",
- "address":"Pla Del Marquu00e8s, 13",
- "description":"<p><b>THIS ADVERT IS NOT RELA[... cropped to sample ...] ts and acting as represenattive on site.</p>",
- "imageUrl":"http://www.parseme.vacau.com/oc-content/uploads/65.jpg"
- },
- "30":{
- "adUrl":"http://www.parseme.vacau.com/index.php?page=search&sCategory=30",
- "title":"Engineering Barcelona",
- "salary":"2300.00 Euro u20ac",
- "category":"ENGINEERING - ARCHITECTURE",
- "publishedDate":"2013-05-07",
- "modifiedDate":"2013-05-27",
- "country":"Spain",
- "region":"Barcelona",
- "city":"Barcelona",
- "cityArea":"",
- "address":"",
- "description":"<p><b>THIS ADVERT IS NOT RELA[... cropped to sample ...] ts and acting as represenattive on site.</p>",
- "imageUrl":"http://www.parseme.vacau.com/oc-content/uploads/48.jpg"
- }
- }
- <?php
- $json = '{
- "26":{
- "adUrl":"http://www.parseme.vacau.com/index.php?page=search&sCategory=26",
- "title":"Engineering Geologist Figueres",
- "salary":"2300.00 Euro u20ac",
- "category":"ENGINEERING - ARCHITECTURE",
- "publishedDate":"2013-05-07",
- "modifiedDate":"2013-05-27",
- "country":"Spain",
- "region":"Girona",
- "city":"Figueres",
- "cityArea":"Vilatenim",
- "address":"Pla Del Marquu00e8s, 13",
- "description":"<p><b>THIS ADVERT IS NOT RELA[... cropped to sample ...] ts and acting as represenattive on site.</p>",
- "imageUrl":"http://www.parseme.vacau.com/oc-content/uploads/65.jpg"
- },
- "30":{
- "adUrl":"http://www.parseme.vacau.com/index.php?page=search&sCategory=30",
- "title":"Engineering Barcelona",
- "salary":"2300.00 Euro u20ac",
- "category":"ENGINEERING - ARCHITECTURE",
- "publishedDate":"2013-05-07",
- "modifiedDate":"2013-05-27",
- "country":"Spain",
- "region":"Barcelona",
- "city":"Barcelona",
- "cityArea":"",
- "address":"",
- "description":"<p><b>THIS ADVERT IS NOT RELA[... cropped to sample ...] ts and acting as represenattive on site.</p>",
- "imageUrl":"http://www.parseme.vacau.com/oc-content/uploads/48.jpg"
- }
- }';
- $arr = json_decode($json, true);
- $last_arr = end($arr);
- foreach ($last_arr as $key => $value) {
- $message .= $value . '<br>';
- }
- require 'PHPMailerAutoload.php';
- $mail = new PHPMailer;
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup server
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'jswan'; // SMTP username
- $mail->Password = 'secret'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
- $mail->From = 'from@example.com';
- $mail->FromName = 'Mailer';
- $mail->addAddress('josh@example.net', 'Josh Adams'); // Add a recipient
- $mail->addAddress('ellen@example.com'); // Name is optional
- $mail->addReplyTo('info@example.com', 'Information');
- $mail->addCC('cc@example.com');
- $mail->addBCC('bcc@example.com');
- $mail->WordWrap = 50; // Set word wrap to 50 characters
- $mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Here is the subject';
- $mail->Body = $message;
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- exit;
- }
- echo 'Message has been sent';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement