Advertisement
Guest User

Untitled

a guest
Jan 29th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors',1); // enable php error display for easy trouble shooting
  3. error_reporting(E_ALL); // set error display to all
  4. $_POST['submit'] = 'submit';
  5. $_POST['email1'] = 'test1@email.com';
  6. $_POST['email2'] = 'test2@email.com';
  7. $_POST['email3'] = 'test3@email.com';
  8.  
  9. if(isset($_POST['submit'])) {
  10.    
  11.     $email_to = "666international@mail.com,sohaanmashwani@gmail.com,cinephoto@mail.com" ; // The email you are sending to (example)
  12.     $email1_from = $_POST['email1']; // The email you are sending from (example)
  13.     $email2_from = $_POST['email2'];
  14.     $email3_from = $_POST['email3'];
  15.     $email_subject = "Emails Record"; // The Subject of the email
  16.    $fileatt = "/home/oskajan123/public_html/version_02/images/email.jpg"; // Path to the file (example)
  17.     $file = fopen($fileatt,'rb');
  18.     $data = fread($file,filesize($fileatt));
  19.     fclose($file);
  20.     $image_src = base64_encode($data);
  21.         $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
  22.     $headers .= "From:" .",". $email1_from .",". $email2_from .",". $email3_from; // Who the email is from (example)
  23.         $email_message = "
  24.         <html>
  25.         <head>
  26.         </head>
  27.         <body>
  28.             <p>Text Body of Message</p>
  29.             <img src='data:image/jpg;base64,".$image_src."' alt='' style='width: 300px;' />
  30.         </body>
  31.         </html>";
  32.     if (mail($email_to,$email_subject,$email_message,$headers)) {
  33.     echo 'Successfully Sent';
  34.     } else {
  35.     echo 'Message Sending Failed';
  36.     }
  37.  
  38. }
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement