Welcome to Dream.In.Code
Click Here
Getting PHP Help is Easy!

Join 117,610 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,965 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Email Application

 
Reply to this topicStart new topic

Email Application

webmin
post 11 Jul, 2008 - 07:20 PM
Post #1


D.I.C Head

**
Joined: 21 May, 2008
Posts: 95


My Contributions


I'm very new at php, but I've been paying attention in my C programming class so I can catch on very quick. (I see some similarities or functions that I recognize)

Anyways, I use Cubcart V3 ecomerce system, and I think it would be great to be able to add a way to check the store's email via the admin panel.

It really just needs to be a simple email program, being able to check for messages and download them to the correct folder, sending messages, deleting them would be nice to.

If there is anyone here willing to teach me how to pull off a project like this, I am willing to learn, or if anyone knows where I can get a free crash course in php scripting, that'd be awesome to.

Thanks in advanced.
User is offlineProfile CardPM

Go to the top of the page


Martyr2
post 12 Jul, 2008 - 04:47 PM
Post #2


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 4,613



Thanked 116 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


Well before you start on the email part of your PHP page, you will want to have played around quite a bit with some PHP code before attempting it. Just because it not only involves PHP but also understanding some of how POP3 works. Below are some tutorial sites you can check out for learning...

PHP Tutorial - HTML Goodies

Introduction to PHP Programming - Developer Tutorials

PHP Manual - PHP.NET (Bookmark this, you will need it from time to time)

The code below provides you an introduction of how to access email using PHP and making your own email reader like all the ISPs do it.

PHPit - Read your e-mail with PHP tutorial

That should be quite a bit to get you started. Enjoy and good luck. smile.gif
User is online!Profile CardPM

Go to the top of the page

chili5
post 13 Jul, 2008 - 09:15 AM
Post #3


D.I.C Regular

***
Joined: 28 Dec, 2007
Posts: 487



Thanked 4 times
My Contributions


Here's a really good PHP tutorial that will probably help you along with the one's listed above:

PHP tutorial

These links will help you and then hopefully you'll be able to figure out how to make your email page. biggrin.gif
User is offlineProfile CardPM

Go to the top of the page

webmin
post 13 Jul, 2008 - 06:05 PM
Post #4


D.I.C Head

**
Joined: 21 May, 2008
Posts: 95


My Contributions


Thanks guys for your help. I've been reading through these and one thought just hit me on the PHPit page you listed. There was a section of code where he talked about removing read messages from the server.

CODE

// Remove from mail server
$do = $pop3->delete_mail ($i);
if ($do == false) {
        echo $pop3->error;
}


I noticed this was set to false, so that means it won't delete those messages correct?....

Also I understand that this was a basic script, however for security reasons, I wouldn't want someone to be able to just look at my php file and figure out my username & pass. Basically I'd like to replace this section of code:
CODE

// Connect to mail server
$do = $pop3->connect ('YOUR-EMAIL-SERVER-HERE);
if ($do == false) {
        die($pop3->error);
}


with a login page where I would type that in, also on that same page I would like to replace this section of code:
CODE

// Login to your inbox
$do = $pop3->login ('email@address.goes.here.com, 'password-here');

if ($do == false) {
        die($pop3->error);
}

echo '
Logged in';

with a box for the user to input that info. Again thanks for the help, and anymore help is appreciated.

This post has been edited by webmin: 13 Jul, 2008 - 06:06 PM
User is offlineProfile CardPM

Go to the top of the page

ahmad_511
post 13 Jul, 2008 - 11:06 PM
Post #5


D.I.C Regular

Group Icon
Joined: 28 Apr, 2007
Posts: 351



Thanked 8 times

Dream Kudos: 400
My Contributions


Hi,
QUOTE
I wouldn't want someone to be able to just look at my php file and figure out my username & pass.


No one (but you) can read your user name and password
the php script will executed on the server sidde and the only thing the clients can see is what you're echoing from within your script.
so, your script is in good hands in this case:)

This post has been edited by ahmad_511: 13 Jul, 2008 - 11:08 PM
User is offlineProfile CardPM

Go to the top of the page

chili5
post 14 Jul, 2008 - 03:22 AM
Post #6


D.I.C Regular

***
Joined: 28 Dec, 2007
Posts: 487



Thanked 4 times
My Contributions


QUOTE(webmin @ 13 Jul, 2008 - 06:05 PM) *


Also I understand that this was a basic script, however for security reasons, I wouldn't want someone to be able to just look at my php file and figure out my username & pass. Basically I'd like to replace this section of code:


Nobody can see your password and username except for people who have access to the actual files. The PHP interpreter reads the code and returns the HTML page. The browser will never see the PHP code. Your username and password is safe smile.gif
User is offlineProfile CardPM

Go to the top of the page

mocker
post 14 Jul, 2008 - 08:28 AM
Post #7


D.I.C Head

**
Joined: 14 Oct, 2007
Posts: 219



Thanked 11 times
My Contributions


For extra security it is a good idea to put any login type information into a php file that is outside of your web directory, and then include it. Even though no one else should be able to see your php file, it is generally easier for intruders to get access to your web directory, and this also prevents against errors with your web server configuration that could cause php to be rendered as text.

As far as making it selectable, just have a form where the user can enter login details and address, then grab it with $_POST
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 11:44PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month