0

How would I go about the following:

  • Client send email with attachment to upload@mycompany.com
  • Email server detects email received
  • Attachment uploaded to remove FTP location
  • Email sent to client confirming upload

Would like to use PHP.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Franco
  • 2,846
  • 7
  • 35
  • 54
  • 1
    What email server are you using? Pretty much all unix-based ones can have an account pipe incoming mail to a program which could do your extraction/ftping. – Marc B Mar 30 '12 at 19:24
  • Similar question: http://stackoverflow.com/questions/114953/how-to-get-email-and-their-attachments-from-php – kevingreen Mar 30 '12 at 19:30

1 Answers1

0

If @Marc B answer is not possible, you can use the php_imap extension. Some examples are available here, and of course at php.net

AFter that, uploading via FTP is trivial using PHP FTP functions (here)

haltabush
  • 4,508
  • 2
  • 24
  • 41
  • php_imap would depend on a php script reaching out to the mail server to check if there's any mail. I think OP wants something that happens automatically the instant an email with attachment comes in – Marc B Mar 30 '12 at 19:39
  • That's why I've added the first "if" :) I know that in my company, I can't access the email server directly (it's provided by Gmail) – haltabush Mar 30 '12 at 19:40