/** * Asign all the vars in the class */ $mimemail->set_from($from); $mimemail->set_to($to); $mimemail->set_subject($subject); $mimemail->set_text($text); $mimemail->set_html($html); // Shortcut to declare the 5 lines above // $mimemail->new_mail($from, $to, $subject, $text, $html); /** * Adding Atachments with it's file name, you can see the * image name in the method is the same declared in the HTML text * for the Embedded Image works */ $mimemail->add_attachment($attach_image, "my_image.jpg"); $mimemail->add_attachment($attach_file, "my_file.gz"); /** * Asign the SMTP values to connect. * If you dont need Auth SMTP you can comment the set_smtp_auth method. * If you dont need any SMTP you can comment both lines and the mail sends via * PHP mail function. */ //$mimemail->set_smtp_log(true); // If you need debug SMTP connection $mimemail->set_smtp_host($smtp_host); $mimemail->set_smtp_auth($smtp_user, $smtp_pass); /** * Send the mail */ if ($mimemail->send()) { echo "The MIME Mail has been sent";