6 Replies - 892 Views - Last Post: 14 July 2008 - 08:28 AM Rate Topic: -----

#1 webmin  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 256
  • Joined: 21-May 08

Email Application

Posted 11 July 2008 - 07:20 PM

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Email Application

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4354
  • View blog
  • Posts: 12,160
  • Joined: 18-April 07

Re: Email Application

Posted 12 July 2008 - 04:47 PM

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. :)
Was This Post Helpful? 0
  • +
  • -

#3 chili5  Icon User is offline

  • D.I.C Lover

Reputation: 20
  • View blog
  • Posts: 1,144
  • Joined: 28-December 07

Re: Email Application

Posted 13 July 2008 - 09:15 AM

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. :D
Was This Post Helpful? 0
  • +
  • -

#4 webmin  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 256
  • Joined: 21-May 08

Re: Email Application

Posted 13 July 2008 - 06:05 PM

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.

// 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:
// 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:
// 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 July 2008 - 06:06 PM

Was This Post Helpful? 0
  • +
  • -

#5 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Re: Email Application

Posted 13 July 2008 - 11:06 PM

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 July 2008 - 11:08 PM

Was This Post Helpful? 0
  • +
  • -

#6 chili5  Icon User is offline

  • D.I.C Lover

Reputation: 20
  • View blog
  • Posts: 1,144
  • Joined: 28-December 07

Re: Email Application

Posted 14 July 2008 - 03:22 AM

View Postwebmin, on 13 Jul, 2008 - 06:05 PM, said:

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 :)
Was This Post Helpful? 0
  • +
  • -

#7 mocker  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 50
  • View blog
  • Posts: 466
  • Joined: 14-October 07

Re: Email Application

Posted 14 July 2008 - 08:28 AM

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1