contact form with file attachement

Discussion in 'PHP' started by slayer, Jun 17, 2007.

  1. #1
    pff i searched quite a lot and didnt find a free script that can do it(allow files to be attached with the contact form and send it to my email using php mail() )

    if anyone knows a free script that can do this please help me out a little

    thanks,
    tom
     
    slayer, Jun 17, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    EDIT:

    Or have a look at this:
    http://forums.digitalpoint.com/showthread.php?t=355702




    http://phpmailer.sourceforge.net/

    
    require("mail.inc.php");
    
    // Instantiate your new class
    $mail = new MyMailer;
    
    // Now you only need to add the necessary stuff
    $mail->AddAddress("josh@site.com", "Josh Adams");
    $mail->Subject = "Here is the subject";
    $mail->Body    = "This is the message body";
    $mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip");  // optional name
    
    if(!$mail->Send())
    {
       echo "There was an error sending the message";
       exit;
    }
    
    echo "Message was sent successfully";
    
    PHP:
    http://phpmailer.sourceforge.net/extending.html
     
    nico_swd, Jun 17, 2007 IP
    slayer likes this.
  3. slayer

    slayer Well-Known Member

    Messages:
    1,926
    Likes Received:
    85
    Best Answers:
    0
    Trophy Points:
    165
    #3
    great stuff! thanks a lot
    currently il modify krakjoe's script to fit my needs, i will check out phpmailer later

    rep added :)
     
    slayer, Jun 17, 2007 IP
  4. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #4
    please change the address in that script your spamming my inbox !!

    lol @ u 2
     
    krakjoe, Jun 17, 2007 IP
  5. slayer

    slayer Well-Known Member

    Messages:
    1,926
    Likes Received:
    85
    Best Answers:
    0
    Trophy Points:
    165
    #5
    i changed it, sorry i uploaded the unmodified version not the one i modified thats why it happened :)
     
    slayer, Jun 17, 2007 IP