Right this is stressing me out! I'm trying to connect to my gmail account through my website and I'm using this:

<?php
$server = "imap.gmail.com";
$user = "user@gmail.com";
$pass = "pass";
$conn = @imap_open("\{$server:993/imap/ssl}INBOX", $user, $pass)
or die("Connection to server failed: ". imap_last_error());
?>

(obviously with my own u/p) I have also enabled it in googlemail i'm using MAMP server. I get this error:

Connection to server failed: Can't open mailbox \{imap.gmail.com:993/imap/ssl}INBOX: no such mailbox

Any suggestions? :(

Although I haven't tried using imap with gmail I have heard of gmail api's that can be used (unofficial ones) where you can easily connect to gmail and send mail via gmail. So try googling for php gmail api or something like that.

Hey, thanks :) could it be to do with the fact i'm on MAMP?

If your using MAMP for Mac then although it would be harder to setup a program like mailman, api's should still work for remote smtp.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.