Log in

View Full Version : Webmail client



[Nicolas]
10-13-2010, 02:15 AM
I have successfully made a webmail (like Gmail) except I have one issue. I can send emails out, but can't recieve them like, in an inbox inside of that page. How could I make that work if that user doesn't have another webmail?
Also, how could I censor out profane language with php?
Try it out here. You'll recieve the email in like 20 mins :P
http://kapleenmusic.webfreehosting.net/testfolder/email.htm

Sendmail.php:

<?php
$to = $_REQUEST['email'];
$email = $_REQUEST['eml'] ;
$name = $_REQUEST['id'] ;
$subject = "Message from: $id";
$message = $_REQUEST['message'] ;
$headers = "noreply@YOURWEBSITE.com";
$body = "From: $name \n\n Email: $email \n\n Wesbite: $site \n\n Message: $message";
$sent = mail($to, $subject, $body, $headers) ;
if($sent)
{echo "<script language='JavaScript'>window.location='Success.htm'</script>";}
else
{echo "<script language='JavaScript'>window.location='Error.htm'</script>";}
?>

bluewalrus
10-13-2010, 02:36 AM
This isn't a mail client it's a script that sends mail from your server. I assume your server is using smtp to send the email.

http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol#SMTP_vs_mail_retrieval

There are ways to get email but it is more technical. This has been talked about here (posts after 7)

http://www.dynamicdrive.com/forums/showthread.php?t=58065

and the php functions are here:

http://php.net/manual/en/book.imap.php

You also might find it better to use the PHP header location than the javascript window.location.

http://php.net/manual/en/function.header.php

[Nicolas]
10-13-2010, 03:24 AM
Ok that was helpful but I am still unsure of how to recieve email or what to do to make that possible.
But thanks for the links they are helpful! :)

bluewalrus
10-13-2010, 04:11 AM
If you are receiving the email on your own server and you already have that part configured. You can use this to set it up

http://www.php.net/manual/en/function.imap-open.php

Here's an example using gmails server(s).

http://davidwalsh.name/gmail-php-imap