Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 7 of 7
  1. #1
    Enthusiast Abadax's Avatar

    Join Date
    Apr 2009
    Location
    North America
    Posts
    1,723

    Automatic E-mail Embeding

    Sup DD. I don't post here as often as I used to. Though, I'm grounded, so that kinda explains it well. Though I have scored a nice job as a small time web developer, my mom is allowing me to do some work for my boss, and I need some help, with programing.


    Anyway, in short, I'm making a site for a roller skating rink. Darrel, my boss, wants to know if it is possible, and if so how to do it, to have an e-mail that can be sent photos. When said e-mail receives a photo, it automatically embeds it in the website. I'm sure it is quite possible, but I wouldn't quite know where to start, other than knowing it requires java, and server programing.

    Please keep in mind, that I have barely scratched the surface of Java, and haven't even touched php or any other server programing for that matter. So I might not understand something at first.

    Thanks for your help, guys.

  2. #2
    lucien is queen Hazzystan's Avatar

    Join Date
    Feb 2008
    Location
    Scotland
    Posts
    2,977

    Re: Automatic E-mail Embeding

    Does it have to involve e-mail? It would be much easier to just write a form on your website where the user selects an image which is uploaded and embedded onto the site.
    what is homo love?

  3. #3
    Enthusiast Abadax's Avatar

    Join Date
    Apr 2009
    Location
    North America
    Posts
    1,723

    Re: Automatic E-mail Embeding

    I see your point, but it would be a bit more convenient for someone with a phone to send a picture to an e-mail on their phone. Plus, it would eliminate the need for use accounts. We don't want random people trying to upload photos. So all we need to do is hand out the e-mail to a select few people. Unless of course the picture is taken with a much higher quality camera. That might pose a problem.

    In the long run, it may be a bit more simple to just send it to an e-mail, unless the coding is going to be way more complex than I think...

  4. #4
    Veteran Enthusiast
    Join Date
    May 2006
    Location
    Midlands, UK
    Posts
    5,638

    Re: Automatic E-mail Embeding

    A password restricted form would be better imo.

    What's the exact purpose? Is it a hosting site?

  5. #5
    Enthusiast Abadax's Avatar

    Join Date
    Apr 2009
    Location
    North America
    Posts
    1,723

    Re: Automatic E-mail Embeding

    No. Its advertising a skating rink. He wants the fastest and easiest way possible to update pictures, so we don't have pictures from two or something years ago sitting on the site later down the road. When we snap a new one, send, bam, its on the site. That's what he wants.

  6. #6
    Veteran Enthusiast LeadingManNigel's Avatar


    Join Date
    May 2005
    Location
    New York City
    Posts
    6,213

    Re: Automatic E-mail Embeding

    Write a script that fetches images from an email and uploads it to the server then have a gallery that loads the latest images? Doesn't sound too difficult, you could probably just grab some ajax or w/e gallery script and make modifications to support what you want to do. I'm pretty sure most major email services has an api for use.

  7. #7
    Senior Member Terror's Avatar

    Join Date
    Aug 2008
    Posts
    309

    Re: Automatic E-mail Embeding

    Tell your boss that the best way to go about getting the images is to have an email domain set up, like godaddy, unless you have your own server.

    But anyways this is probably the only way I know how to do this. I don't recommend it even if you have a server, because they could just upload a virus :\

    [spoiler:1did7qfx]html code for the website...
    Code:
    <form action="website domain="multipart/form-data" method="post">
    
    
    
    Type some text (if you like):
    
    <input type="text" name="textline" size="30">
    </p>
    
    
    
    Please specify a file, or a set of files:
    
    <input type="file" name="datafile" size="40">
    </p>
    <div>
    <input type="submit" value="Send">
    </div>
    </form>
    Then with your server, a php script...
    Code:
    <?php
    if ((($_FILES["file"]["type"] == "image/gif")
    || ($_FILES["file"]["type"] == "image/jpeg")
    || ($_FILES["file"]["type"] == "image/pjpeg"))
    && ($_FILES["file"]["size"] < 20000))
      {
      if ($_FILES["file"]["error"] > 0)
        {
        echo "Return Code: " . $_FILES["file"]["error"] . "
    ";
        }
      else
        {
        echo "Upload: " . $_FILES["file"]["name"] . "
    ";
        echo "Type: " . $_FILES["file"]["type"] . "
    ";
        echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
    ";
        echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
    ";
    
        if (file_exists("upload/" . $_FILES["file"]["name"]))
          {
          echo $_FILES["file"]["name"] . " already exists. ";
          }
        else
          {
          move_uploaded_file($_FILES["file"]["tmp_name"],
          "upload/" . $_FILES["file"]["name"]);
          echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
          }
        }
      }
    else
      {
      echo "Invalid file";
      }
    ?>
    [/spoiler:1did7qfx]You should really consider a form or just leaving one of these on your website.

    [spoiler:1did7qfx]
    Code:
    <a href="mailto:youremail@youremail.com?subject=Photos
    &body=Attach the images of your choice!">Email Me</a>
    [/spoiler:1did7qfx]


 

Posting Permissions

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