Forum Moderators: coopster

Message Too Old, No Replies

email file to web server?

         

nichenet

11:14 pm on Jan 14, 2007 (gmt 0)

10+ Year Member



Hi - I'm looking for a way to allow a user to email files (as attachments) to a specific email address - then those files would be accessible in the public web directory of a server.

Here's the situation - a client generates invoices daily via a desktop application - which typically emails the pdf invoices to their customers. The client wants to have the pdf invoices available for their customers to retrieve online (when logged into their site). So I thought since they're emailing them anyway - if I could come up with a way to email directly to a web accessible directory - that would save the book-keeping dept from having to save the invoices and ftp them up on a daily basis.

Any ideas / thoughts / suggestions would be very much appreciated

Thanks
Dave
NicheNET Inc.

cmarshall

11:22 pm on Jan 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know it could be done via PHP's mailing support, but it is a bit complex and prone to error. You're probably better off using an API like SOAP/RPC [w3.org].

mcavic

8:13 am on Jan 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Receiving mail to a script is complicated, but there are two ways to do it. You can send it to a mailbox and have the script check the mailbox periodically using POP or IMAP. Or set up the address to forward mail to the script immediately using procmail.

If you're using POP or IMAP, it looks like there are functions to help pull out and decode attachments. If you're using procmail, you could try PHP's mailparse extension.

An automated FTP routine might be more secure, though.