SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Nov 2007
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP form that can send me an image

    I'm interested in creating a form (using php) on a site where someone can browse their h/d for an image and the image gets sent to me in an email. Is this possible to do?

    Thanks,

    Mim

  2. #2
    SitePoint Evangelist ferrari_chris's Avatar
    Join Date
    Mar 2008
    Location
    NP, New Zealand
    Posts
    576
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is possible, yes.

    There are two parts to this you'll need to look at:

    The first is uploading the image to your server (and the validation surrounding that).

    The second is then sending that image to you via email - either as an inline HTML element or as an attachment.

    To simplify the process, you may want to simply have the email sent to you contain a link to the image on your server? This will be easier than sending the image attached, but then that's not overly difficult. Although, this may not be suitable.

    But what you want to do is possible with PHP, yes.

  3. #3
    SitePoint Addict silentcollision's Avatar
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    388
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure.

    It would probably be easier to make it upload to your host, and then send you the link, but you could look into sending the image as an attachment if you wanted.

    Check out file uploads if you want to upload it to your host, but remember to validate your image. Check its mime type and its extension.

  4. #4
    SitePoint Member
    Join Date
    Apr 2004
    Location
    Des Moines, Iowa
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For little tasks such as file uploading and emailing, you can find some well written classes at phpclasses.org (full of ads, but very useful stuff in there). There is no shame in using other people's code if it makes development for you faster.


Tags for this Thread

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
  •