Hi. Some Rocket Science...

1 view
Skip to first unread message

garymarbach

unread,
Jan 9, 2009, 9:31:12 AM1/9/09
to GMusers- GMail Beta & Beyond
I'm new to this group. I joined because it seemed like a place I
might be able to learn more about google and gmail access.

I would like to do some scripting (prefer PHP) that reads a gmail
message, optionally adds the sender to my contacts, send an email back
to the sender (from the gmail name/mailbox I'm working with at the
time), and again - optionally - mark that email as 'read'... all from
the one script, if possible.

I'm sure that none of this is rocket science, but I'm having a tough
time finding any real 'tutorial' or 'example' on it.

If you were going to approach this, what would you do?

Thanks - appreciate your guidance of a lost newbie.

Gary

Marilyn K Hald

unread,
Jan 9, 2009, 11:38:57 PM1/9/09
to GMu...@googlegroups.com
not to be a smart ass but i would do the as as you.  ask.  this group has some very smart individuals in it when it comes to gmail.

--- On Fri, 1/9/09, garymarbach <garym...@gmail.com> wrote:

nabil salhab

unread,
Jan 11, 2009, 10:31:58 AM1/11/09
to GMu...@googlegroups.com
Well,I can advice you to try a (Trial and error) method ,may be it works.

garymarbach

unread,
Jan 11, 2009, 9:51:29 AM1/11/09
to GMusers- GMail Beta & Beyond
Marilyn - I've read your post a couple of times and don't understand
it - sorry. Mine is a question about doing something pretty straight
forward - its just that I haven't found a tutorial for it. I didn't
imply anything about others knowledge levels at all - and would not do
that.

Ryan Morehart

unread,
Jan 11, 2009, 12:02:12 PM1/11/09
to GMu...@googlegroups.com
On Fri, Jan 9, 2009 at 9:31 AM, garymarbach <garym...@gmail.com> wrote:
> I would like to do some scripting (prefer PHP) that reads a gmail
> message, optionally adds the sender to my contacts, send an email back
> to the sender (from the gmail name/mailbox I'm working with at the
> time), and again - optionally - mark that email as 'read'... all from
> the one script, if possible.

You should be able to do everything you want to do simply by enabling
IMAP in Gmail then accessing it using the standard POP IMAP library.
You should be able to find tutorials for using the standard library
fairly easily and you can figure out what to give

http://us.php.net/imap

Ryan

Max Schubert

unread,
Jan 11, 2009, 12:26:59 PM1/11/09
to GMu...@googlegroups.com
Adding a sender to your contacts list probably can't be done through
IMAP, for that you will need a web automation library.

I still limit my use of PHP to web-based projects.

That siad, WWW::Mechanize for perl and the same named library for ruby
both work very well for this purpose. Python also has an excellent
web automation library as well.

I believe there is a similar package for PHP.

If you are familiar with perl or ruby or python you will probably find
this project will be much easier to complete using one of them instead
of PHP :).

- Max

Max Schubert

unread,
Jan 11, 2009, 12:17:15 PM1/11/09
to GMu...@googlegroups.com
Gary,

Look at the IMAP libraries available for PHP; that is the easiest way
to programatically manipulate a Gmail mailbox you own. I have done
this kind of work using ruby as the programming language and it was
relatively easy.

If you search Google :p for

Gmail and IMAP and PHP

I bet you will find tutorials or blog posts (I found blog posts) that
helped me out.

If not Gmail specific tutorials, there are many PHP tutorials on
programmatic control of IMAP I am sure :).

If PHP fails you, try ruby or perl, both have well done IMAP libraries.

- Max

Marilyn K Hald

unread,
Jan 11, 2009, 11:48:19 PM1/11/09
to GMu...@googlegroups.com
i dont believe they have ever created a tutorial.  at least one that i have ever heard about..


--- On Sun, 1/11/09, garymarbach <garym...@gmail.com> wrote:
From: garymarbach <garym...@gmail.com>
Subject: [GMusers] Re: Hi. Some Rocket Science...
To: "GMusers- GMail Beta & Beyond" <GMu...@googlegroups.com>

garymarbach

unread,
Jan 12, 2009, 11:12:50 AM1/12/09
to GMusers- GMail Beta & Beyond
Godaddy has told me that I can't have IMAP access via my website.

I have seen cases where they supply some access and their customer
service folks simply don't know what is available and what is not
available .... but I haven't learned yet how to tell if I really can
access IMAP stuff from my site. I should probably test that. So, if
anyone knows a simple test to do to see if IMAP is accessible from my
site (preferable a PHP oriented test), please let me know.

That said, I'm hoping that PERL, Ruby, or Python approaches can do
what I need to do without requiring IMAP... What do you think? Is
that possible?

If IMAP is the ONLY way to achieve this stuff, I guess I will need to
get another host...

Thank you all for the great assistance!

Gary
Reply all
Reply to author
Forward
0 new messages