Jump to content
xisto Community
Sign in to follow this  
karlosantana

Php Email System

Recommended Posts

Hey guys, I Really need a PHP based email system it needs to be able to

Send and Recieve E-mails

Upload and download Attatchments

Create emails (WYSIWYG is ideal!)

I actually already have one here Which is copied from a tutorial but this is why it isn't practical.

I am making a control panel for a subdomain that i've given to my friend, He needed an email address (so i gave him one). Now I adore squirell mail, I even tried to make that work to what i want! So basically what needs to happen is

Bob will log onto his control panel that i will be building, He will then click a button titled E-mail Now heres the bit i've been struggling with it will automatically log him on.

 

His email address is

kieran@rotf.urbaninsticts.trap17.com

So rather than him having to type that all the time it'll already know it.

Like cPanel, That is ideal! That is exactly how I want it!

You just go into Read Webmail and hey presto your done, no login in needed I've attached the File I've used if anyone wants to look and possibly edit :o

How would I make the login screen automatically, "put" the email address in?

 

Well rather than ask any more questions and confuse everyone some more, Look at your cPanel on trap in E-mail Is a section that says Read webmail... Click it it then takes you to a choice of two, But when you click it your reading your default email account!

Am I making sense now? lol (I do annoy people with not making sense so i've tried my best!)

Thanks to anyone in advance

karlos

Opps forgot to attach file

p.s I was wondering how would I make it use cookies? would that help? If yes then how do i make my email system use a cookie rather than a login screen?

PHPMail3_mail.zip

Edited by karlosantana (see edit history)

Share this post


Link to post
Share on other sites

Ok i've only given half the story there, here's the login script. It uses a msql table called members, and in that is

user_id
user_name
user_password

I wonder if i was to put a user_email in it and then get the email system above to recall it using echo?
If im wrong there can you please correct me? I would just need it to call the user_email from the MYSql database
As you would've guessed I've just started with php! SO any help and tips and things will help greatly!
ok here goes

<?phpob_start();$host="localhost"; // Host name$username=""; // Mysql username$password=""; // Mysql password$db_name="test"; // Database name$tbl_name="members"; // Table name// Connect to server and select databse.mysql_connect("$host", "$username", "$password")or die("cannot connect");mysql_select_db("$db_name")or die("cannot select DB");// Define $myusername and $mypassword$myusername=$_POST['myusername'];$mypassword=$_POST['mypassword'];$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";$result=mysql_query($sql);// Mysql_num_row is counting table row$count=mysql_num_rows($result);// If result matched $myusername and $mypassword, table row must be 1 rowif($count==1){// Register $myusername, $mypassword and redirect to file "login_success.php"session_register("myusername");session_register("mypassword");header("location:login_success.php");}else {echo "Wrong Username or Password";}ob_end_flush();?>
Any help is appreciated! Thanks in advance
Karlos
EDIT: i had put the wrong version of my script in, its better now!
Edited by karlosantana (see edit history)

Share this post


Link to post
Share on other sites

I had never used the $_SESSION before, because I always used cookies, but I just looked it up, and it said you need to do a "session_start()" before reading from the $_SESSION[] vars, if you haven't called a session_register on that page.So on the page you're going to (login_success.php), make sure you're calling session_start() before reading to see if they're logged in.Also, most browsers should have the "remember me" box pop up when you're logging in, if that's part of what you were talking about.

Share this post


Link to post
Share on other sites

I had never used the $_SESSION before, because I always used cookies, but I just looked it up, and it said you need to do a "session_start()" before reading from the $_SESSION[]vars, if you haven't called a session_register on that page.

Hmm interesting point but it works fine as it is, so im content as a cucumber to leave it as it is. You use cookies? do tell!

So on the page you're going to (login_success.php), make sure you're calling session_start() before reading to see if they're logged in.

My page does include that! hehe i guess I should've mentioned it really, And i've just made a logout script to (YAY) I am very new to php. So this is a huge learning curve for me!

Also, most browsers should have the "remember me" box pop up when you're logging in, if that's part of what you were talking about.

No it wasn't. I need basically to make a php email Client for ONE account I think i've made one though (eeek) so any help is well appreciated, you seem to know your stuff when it comes to php and tips you can give me are appreciated!Thanks again
karlos

Share this post


Link to post
Share on other sites

the thing you ask is quiet something, it's total mail solution loli found and used something which was quite good for sending emails, the problem with it is gmail takes that as spam and also it can not reflect html codes properly if you attach something (when you modify it it goes funny a bit) but it works for sending attachments.it never passed my mind to code something or find some codes to receive emails as well. why you need it?

Edited by threepach (see edit history)

Share this post


Link to post
Share on other sites

I'm making something and in it I need an email system.But could the above be done? could i make a "bridge" between my login script and my email script?Thanks for the help!karlos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.