コード例 #1
0
    $my_mail = new attach_mailer($name = $_POST['from_name'], $from = $_POST['from_email'], $to = $_POST['mail_to'], $cc = "", $bcc = "", $subject = $_POST['mail_subject']);
    $my_mail->text_body = $_POST['mail_body'];
    $full_path = 'image.gif';
    $my_mail->add_attach_file($full_path);
    $my_mail->process_mail();
    //    // upload part
    //    $my_upload->the_temp_file = $_FILES['upload']['tmp_name'];
    //    $my_upload->the_file = $_FILES['upload']['name'];
    //    $my_upload->http_error = $_FILES['upload']['error'];
    //    if ($my_upload->upload()) {
    //        $full_path = $my_upload->upload_dir . $my_upload->file_copy;
    //        $my_mail->add_attach_file($full_path);
    //        $my_mail->process_mail();
    //        $my_upload->del_temp_file($full_path); // the file is not needed anymore
    //    }
    $msg .= $my_mail->get_msg_str();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Attachment (FORM) Mailer example</title>
        <style type="text/css">
            <!--
            label {
                float:left;
                display:block;
                width:150px;
            }
            input {
コード例 #2
0
<?php

require "attach_mailer_class.php";
$test = new attach_mailer($name = "Olaf", $from = "*****@*****.**", $to = "*****@*****.**", $cc = "", $bcc = "", $subject = "html mail with two images and att.");
//$test->add_html_image("image.gif");
//$test->add_html_image("vcss.png");
//$test->add_attach_file("ip2nation.zip");
$test->html_body = file_get_contents("html_attachment.htm");
$test->text_body = strip_tags($test->html_body, "<a>");
$test->process_mail();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <title>Attachment Mailer example script</title>
    </head>

    <body>
        <h2>Attachment Mailer HTML example</h2>
        <p>This is a HTML example mail script using html code with inline attachments (images) and one regular attatchment. </p>
        <p style="color:#FF0000;"><?php 
echo $test->get_msg_str();
?>
</p>
    </body>
</html>