Having Trouble Attaching Files using PHP

Discussion in 'Web Design and Development' started by DesignEmbrace, Dec 8, 2008.

  1. DesignEmbrace macrumors newbie

    Joined:
    Dec 8, 2008
    #1
    I am having trouble getting files to attach to emails via php. These are my codes. Please Help.
    Send.html


    Send.php
     
  2. Aea macrumors 6502a

    Aea

    Joined:
    May 23, 2007
    Location:
    Denver, Colorado
    #2
    var_dump($_FILES) it's a bit more complicated then just binary data.

    I think you may need to do...

    Code:
    $attachment = file_get_contents($_FILES['userfile']['tmp_name']);
    
     
  3. DesignEmbrace thread starter macrumors newbie

    Joined:
    Dec 8, 2008
    #3
    Still doesn't attach the files :(. Any other suggestions?
     
  4. Aea macrumors 6502a

    Aea

    Joined:
    May 23, 2007
    Location:
    Denver, Colorado
    #4
    Probably has something to do with that not being the way to send attachments, make the proper attachment headers and then send it, you can't just dump that data into the headers and hope an attachment comes through the other end.

    http://www.zend.com/zend/spotlight/sendmimeemailpart3.php

    That may be helpful but over your head if you're new to PHP, I'm sure there's a class somewhere that encapsulates that and allows you to send emails easily with attachments.
     

Share This Page