Results 1 to 2 of 2

Thread: submit a attachment via form

  1. #1
    Join Date
    Apr 2010
    Posts
    40
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default submit a attachment via form

    Hi,
    • In my site I have a form which anyone can submit details via e-mail.

    • Since I want to get more details, I leave a space to upload a document.then visitor can browse & upload the details.


    Please can anyone tell me how can I receive the uploaded document as a e-mail attachment???
    This is my code. please help me by modifying my code to receive the document as e-mail attachment.

    code from contact.html
    Code:
    <form method="post" action="sendeail.php">
    Your Name: <br />
    <input type="text" name="visitor" size="35" />
    <br />
    Your Email:<br />
    <input type="text" name="visitormail" size="35" />
    <br />
    Please attach your details:<br>
    <input type="file" name="attachment" size="23">
    <br />
    Mail Message:
    <br />
    <textarea name="notes" rows="4" cols="40"></textarea>
    <br />
    <br />
    <input type="submit" value="Send Mail" />
    <br />
    </form>
    code from sendeail.php
    PHP Code:
    <?php

    $visitor 
    $_POST['visitor'];
    $visitormail $_POST['visitormail'];
    $notes $_POST['notes'];
    $attn $_POST['attn'];

    $todayis date("l, F j, Y, g:i a") ;
    $attn $attn ;
    $subject $attn;
    $notes stripcslashes($notes);
    $message $todayis [EST] \n

    Attention: 
    $attn \n
    Message: 
    $notes \n
    From: 
    $visitor ($visitormail)\n";
    $from "From: $visitormail\r\n";

    mail("isc_madusanka@yahoo.com"$subject$message$from);

    ?>
    please help me. thank you...................

  2. #2
    Join Date
    Nov 2008
    Posts
    58
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Default

    Accepting file uploads in a form requires several steps. See the page below for some examples:
    create PHP email form with file attachment

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •