TheMarsVoltaire Posted March 2, 2007 Share Posted March 2, 2007 I have a gmail account setup so that it receives a daily email that has a daily bulletin (word doc format) attached. I also have a php based site thats homepage has a space for this daily bulletin. I setup a password protected php script on another page that allows me to paste text (I open and copy the text from the word doc attachment) into a textfield and then update a text file with that copied text. A script in the homepage pulls the text from that text file and loads it into the bulletin space on the page when it loads. My question is, how can I automate this entire process in php? Would it be something like: PHP connects to gmail's pop server, finds and retrieves the email attachment, opens it, copies the text from it, and then edits the text file? Link to comment https://forums.phpfreaks.com/topic/40900-word-doc-email-attachment-website-update/ Share on other sites More sharing options...
Wuhtzu Posted March 2, 2007 Share Posted March 2, 2007 You pretty much has to do what you suggested yourself... the tricky part will be to connect to the mail server, receive the email and extract the attached file - or it probably isn't tricky, I just haven't done it my self I suggest you have a look at this part of the PHP manual: http://no2.php.net/imap When you have created a script to get the text file copied, renamed and uploaded ect. you will have to automate the whole process using something like a cronjob... or if you page is well visited you can rely on your scripts being executed enough to just add a time check: $hour = $date("G",time()) if((18< $hour) && ($hour < 19)){ do your stuff } Link to comment https://forums.phpfreaks.com/topic/40900-word-doc-email-attachment-website-update/#findComment-198098 Share on other sites More sharing options...
TheMarsVoltaire Posted March 2, 2007 Author Share Posted March 2, 2007 I know this is probably impossible, but is there any way of connecting to the pop server with only a default php installation? IMAP requires c-client, and I don't have the privileges to install it nor is my administrator knowledgable enough about PHP to install it for me. Link to comment https://forums.phpfreaks.com/topic/40900-word-doc-email-attachment-website-update/#findComment-198129 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.