Can anyone tell me what the best way to export about 90K emails off of a Yahoo account? The way it stands now, I believe that every email would need to be extracted one by one. I'd like to write a program to do this for me. Can someone give me any ideas as to the best way to so this?
What I am after are the sender email addresses (that are not already in my "contacts") so that I can use them in a list manager.
I would suggest using POP3 access to retrieve your mail. IMAP will be ideal, but not sure if all Yahoo accounts have IMAP access.
You probably do not need to do it programmatically if you just want to archive them.
E.g.: How do I archive messages?
I've done similar tasks with gmail using their IMAP interface and PHP's IMAP package.
Here is the docs: http://php.net/manual/en/book.imap.php
I believe Yahoo Mail also supports IMAP...
I believe Yahoo mail supports IMAP, which would be by far the best way to access the sender name for all your emails. It also looks like PHP has an imap module which will make this easier.
All you have to do is plug the pieces together. :)
Related
As i'm knowing just about PHP and don't know at all about Mail Servers, what i want to know here is:
How can i get the "Replied" emails (from the receivers) for the mails i've send (by using PHP, with a address like xxxxxxx#gmail.com)
Does it need to setup my own Mail Server?
Unless using own Mail Server, is there any other easy way?
Honestly i'm not well understanding over IMAP or Email Protocols. Doing setup my own IMAP Server is far worse. Can it be done simply with a Web Hosting which supporting IMAP protocol? Or do i need to setup manually out from the start?
To be brief, i need a simple guide.
You only need a mail server if you don't already have a place where those reply-tos end up. Which adress are you sending them as? Where would you fetch the emails for those adress? You can ask PHP to log into any mail server that you'd fetch your emails from manually as well, so there shouldn't be a problem. But maybe I'm not getting you right.
Simply put the reply address to an email you own. For the example you gave to work, you would need to have the xxxx#gmail.com account.
Most people use something along the lines of mailer#youdomain.com, ans then create an account for that on their ma8lserver.
If you want to use your own domain, you don't need to run your own mailserver. Gmail, hotmail, and others have services that let you use their mailservers for your fomain, for free.
I know there is plenty of PHP mail libraries out there, but most of them are designed to send emails, is there any library that will help me fetch emails from imap/pop3 accounts, deal with attachments etc?
I'm already using imap_* functions from PHP IMAP extension but using it is problematic, as I have to re-invent the wheel in most cases (ie. parsing the result of imap_fetchstructure to get to attachments)
Mayby there is any ready to use lib build on top of imap_* or similar, that will help me deal with fetching mails, without re-writing all that logic behind well known problems?
I have missed the obvious Zend_Mail will do the trick
Here is a PHP Pop3 Client that I use for a script on my server.
http://www.phpclasses.org/package/2-PHP-Access-to-e-mail-mailboxes-using-the-POP3-protocol.html
You could easily use that to create a graphical layout, but I have not had the necessity for it.
Can anyone suggest the methods I could use...
I m on shared hosting now (cpanel)... I have access to perl modules, ruby, (No idea how they work)
The IMAP extension is used for that. Either by having a real mailbox you check, or by letting the mailserver pipe emails to your your script & parsing the parts of the email with the provided funstions.
PEAR_Mail_MimeDecode class from Pear. Is the real solution.
Possible Duplicate:
Process RECEIVED email attatchment with PHP
If you are a on a shared hosting system it is possibly easiest to let someone like http://cloudmailin.com or http://smtp2web.com/ send the email to your app via a webhook.
You will then need to use something like Mail_MimeDecode to actually parse the message you receive and extract the content you want to use.
I was wondering how one would go about writing a php script to access mail from yahoo or gmail ?
The "simplest" way would be to use IMAP to access the mails (i.e. don't try any kind of HTML scraping !). I have no idea for Yahoo, but I know you can enable IMAP in gmail.
There are several libraries in PHP that allow one to use the IMAP protocol to access a mailbox ; for instance :
There are functions provided in PHP (You might have to install the extension, though) : IMAP, POP3 and NNTP
Or you could use something like Zend_Mail.
You could use the Zend Framework Zend_Mail functionality, this would allow you to connect to GMail/Yahoo/etc with POP3 or IMAP.
One more to add to Pascal's suggestions: libgmailer
i am searching for a way to read mail messages from a PHP application, including access to attachments etc. imap functions are not acceptable as a solution, as this application will handle mails with heavy attachments.
i have full access to the server's mail folder from php via filesystem. any thoughts?
I think you could use a combo of the Pear packages Mail_Mbox and Mail_mimeDecode. Use Mail_Mbox to read new mail from the inbox, one message at a time, and use Mail_mimeDecode to extract the attachements. All this will be done w/o IMAP. You can then save the read messages to a different mbox to keep the inbox clean.
Pear - Mail_Mbox
Pear - Mail_MimeDecode
I had a question like this a while back. See if any of the answers help you:
How to get email and their attachments from PHP
postfix + maildrop was the solution I ended up taking, It routes the emails through to a PHP script when it arrives and in my case, the PHP does something with the attachment. But I only needed to read each email once. If you need to be able to browse all the emails, you either need to store the results of maildrop or find another solution.
If you need to full access to all emails, POP and IMAP are popular choices because they do work. I'm not sure why you're against them.