How to access mail from gmail - php

I was using imap functions in my app to access gmail. Unforunately I have not been able to use imap any more. I am using php. Is there any alternative way like (api..) to access gmail.
I appreciate any help.

In short, no. The only GMail API which provides access to mail is the IMAP one.

You don't explain why you can't use imap any more, but that's ok.
You can use php imap extension to connect with pop3!
Here is an example.

Try Zend Framework:
Code is Here
http://framework.zend.com/manual/en/zend.mail.read.html

Related

Function that gets mail in PHP

Is it possible to write in php such a script that will connect to a mail server like gmail.com and get a mail from it ?
Maybe it sounds naive, but maybe there is a function that will do that ?
There's the IMAP library in PHP.
A quick Google search gave me an example of how to use it.
Yes there is,
Please look into IMAP
http://www.php.net/manual/en/book.imap.php

sending IMAP commands using php

I'm trying to access yahoo mail IMAP server with a php script. I read that yahoo requires a specific IMAP command “ID ("GUID" "1")”. How do I send this command ?
As of this writing, I don't believe you can access Yahoo's IMAP services externally. However, in general, you will want to use socket functions.
http://us.php.net/manual/en/ref.sockets.php
This library was released a couple of days ago and says it supports Yahoo!'s IMAP variant: http://github.com/petewarden/handmadeimap (I've not tried it myself)

google apps is setup on my server, how do i get php mail() to use it?

I've got google apps setup on my server with all the correct MX records etc, now i want to start testing it.
I want to use it for all automated
emails (registration, lost password
etc).
I'm testing on a localhost.
You'll probably want to use PEAR Mail, and set it up using the SMTP settings provided to you by Google. I don't believe the built-in mail() command supports TLS, which is required for sending using Google.
Ok, the solution i've found is to use the PHPMailer class found here:
http://phpmailer.worxware.com/

Access gmail or yahoo mail using script

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

How to export all Yahoo emails using PHP

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. :)

Categories