Jump to content


Photo

Getting file from email


  • Please log in to reply
7 replies to this topic

#1 CanMan2004

CanMan2004
  • Members
  • PipPipPip
  • Advanced Member
  • 254 posts

Posted 18 October 2006 - 01:21 PM

Hi all

I have a email which comes in every 3 days to me, the email contains a CSV file which I have to import into a sql database, I want to try and automate this and let php

access email
pick the file from a selected email
import the file into the database

Can this be done? I'm sure it's quite complex, so any help or guidence would be great

Regards

Dave

#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 18 October 2006 - 01:33 PM

Why not just fetch it from your mail server (POP/IMAP), then do the insert!

Tell me the OS, mail server type (pop, imap) your doing this from, so I can tell you if you can pipe it, or if you need to login and get it from the mail server! After I'll give you a example!


me!

#3 CanMan2004

CanMan2004
  • Members
  • PipPipPip
  • Advanced Member
  • 254 posts

Posted 18 October 2006 - 01:52 PM

Well I would do, but this is new to me, so i'm not sure how to do it.

The server is a linux server
The mail type is pop3

Thanks

Dave

#4 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 18 October 2006 - 02:02 PM

Just simply set it as an attachment.
http://www.phpfreaks...rials/130/0.php

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#5 CanMan2004

CanMan2004
  • Members
  • PipPipPip
  • Advanced Member
  • 254 posts

Posted 18 October 2006 - 03:01 PM

Hi

Set what as an attachment? How do I get it to automatically open the file and upload the CSV file at a chosen time.

Is it going to be more hassle than it's worth?

#6 CanMan2004

CanMan2004
  • Members
  • PipPipPip
  • Advanced Member
  • 254 posts

Posted 18 October 2006 - 07:37 PM

Evening

Can anyone shed any light on this, it would be a great help

Thanks

Dave

#7 CanMan2004

CanMan2004
  • Members
  • PipPipPip
  • Advanced Member
  • 254 posts

Posted 22 October 2006 - 11:33 PM

Can anyone help me on this? I'm still stuck and don't know where to go next with it

Regards

Dave

#8 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 24 October 2006 - 01:11 PM

Oh
I didn't realize what you wanted.  I question whether this is possible.  If it's going to your server email, I would guess set up a cron job 30-46 minutes after the email come's in to open all your email's or a bot with access information, I really have no idea.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users