Hi there
I am trying to build an application where a user can use an
HTML form, fill out some fields, select a file from their
hard drive, and have it emailed as an attachment with the
contents of the form.  (essentially, fill in your name and
address, use my module to attach ms-word file of your
resume, send email of all).

I have the part with the file upload working.
I have the snipet of code from phpWizard (Sasha and Tobias)
http://www.phpwizard.net/resources/phpMisc/scripts/pretty/mail.php3

I am able to make it work with an image as the attachment,
but when I select an MS-WORD document, which is the goal of
this application, it still thinks it's an image, and doesn't
work properly.

I think my problem has something to do with the $ctype.  I
tried application/MSWORD, but that didn't work.
I think this the line of code where the problem is:


                        $attachment =
fread(fopen("test.doc", "r"), filesize("test.doc"));

                          $mail = new mime_mail();
                          $mail->from = "[EMAIL PROTECTED]";
                          $mail->headers = "Errors-To:
[EMAIL PROTECTED]";
                          $mail->to = "[EMAIL PROTECTED]";
                          $mail->subject = "Testing...";
                          $mail->body = "This is just a
test.";

$mail->add_attachment("$attachment", "test.doc",
"application/msword");
                          $mail->send();

Can anyone shed some light on this?  Please??????

thanks
-jen
.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to