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
- $fileatt = "/home/oskajan123/public_html/version_02/images/email.jpg"; // Path to the file (example)
- $file = fopen($fileatt,'rb');
- $data = fread($file,filesize($fileatt));
- fclose($file);
- $image_src = base64_encode($data);
- $headers = "Content-Type: text/html; charset=ISO-8859-1\r\n";
- $headers .= "From:" .",". $email1_from .",". $email2_from .",". $email3_from; // Who the email is from (example)
- $email_message = "
- <html>
- <head>
- </head>
- <body>
- <p>Text Body of Message</p>
- <img src='data:image/jpg;base64,".$image_src."' alt='' style='width: 300px;' />
- </body>
- </html>";
- if (mail($email_to,$email_subject,$email_message,$headers)) {
- echo 'Successfully Sent';
- } else {
- echo 'Message Sending Failed';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement