Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


PHP script help (with attachments)

3 posts in this topic

Recommended Posts

I really need some help I have this emailing system for my website that is PHP based, and some of my e-mailers have been complaining that they can't put attachments in the email (such as images, video, etc.). Unfortunately I haven't added that as an option yet. so can somebody help me incorporate that feature into the script i already have.





This the part of my script that send out the information


/*Type anything but all spam and pornographic content will be blocked*/

$emailSubject = 'Stefanscorner.com (Email)';

$webMaster = 'email address here';

/*Gathering Data Variables*/

$nameField = $_POST ['name'];

$emailField = $_POST ['email'];

$commentsField = $_POST ['comments'];

$body = <<< EOD

Name: $nameField

Email: $emailField

Comments: $commentsField


$headers = "From: $email\r\n";

$headers .= "Content-type: text/html\r\n";

$success = mail($webMaster, $emailSubject, $body, $headers);

/* Results rendered as HTML */

 $theResults = <<< EOD





Thanks in advance.

Share this post

Link to post
Share on other sites

Well, you just have to handle the <input type="file"> in your php, as described in: http://php.net/manual/en/features.file-upl...post-method.php


I suggest to you dinamically create fields using javascript, so you label them "uploadN", in the php you will handle these as in the link above.


To the mail() call, take a look in this tutorial: http://www.webcheatsheet.com/PHP/send_emai....php#attachment

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.