Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors',1); // enable php error display for easy trouble shooting
- error_reporting(E_ALL); // set error display to all
- $_POST['submit'] = 'submit';
- $_POST['email1'] = 'test1@email.com';
- $_POST['email2'] = 'test2@email.com';
- $_POST['email3'] = 'test3@email.com';
- if(isset($_POST['submit'])) {
- $email_to = "666international@mail.com" . "sohaanmashwani@gmail.com" . "cinephoto@mail.com" ; // The email you are sending to (example)
- $email1_from = $_POST['email1']; // The email you are sending from (example)
- $email2_from = $_POST['email2'];
- $email3_from = $_POST['email3'];
- $email_subject = "Emails Record"; // The Subject of the email
- $email_txt = "text body of message";
- $fileatt = "test.jpg"; // Path to the file (example)
- $fileatt_type = "application/jpg"; // File Type
- $fileatt_name = "email.jpg"; // Filename that will be used for the file as the attachment
- $file = fopen($fileatt,'rb');
- $data = fread($file,filesize($fileatt));
- fclose($file);
- $semi_rand = md5(time());
- $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
- $headers="From: " . $email1_from . "," . $email2_from . ",". $email3_from; // Who the email is from (example)
- $headers .= "\nMIME-Version: 1.0\n" .
- "Content-Type: multipart/mixed;\n" .
- " boundary='{$mime_boundary}'";
- $email_message = "This is a multi-part message in MIME format.\n\n" .
- "--{$mime_boundary}\n" .
- "Content-Type:text/html; charset=\"iso-8859-1\"\n" .
- "Content-Transfer-Encoding: 7bit\n\n" . $email_txt;
- $email_message .= "\n\n";
- $data = chunk_split(base64_encode($data));
- $email_message .= "--{$mime_boundary}\n" .
- "Content-Type: {$fileatt_type};\n" .
- " name=\"{$fileatt_name}\"\n" .
- "Content-Transfer-Encoding: base64\n\n" .
- $data . "\n\n" .
- "--{$mime_boundary}--\n";
- echo $email_txt;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement