Jump to content

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.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

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

Link to comment
Share on other sites


  • Create New...