Jump to content

mail();


ngreenwood6

Recommended Posts

I am trying to figure out how to pull emails into the database and then display them. I know how to display information from the database. What I want is to be able to get emails from an email address and enter all the information into the database. For example if test user(test@test.com) sends an email to me(me@me.com) I want my website to pick it up and enter the sender, subject and message into the database so that I may read all the emails in the database from my website. Also, If possible I would also like to be able to delete them from the webserver as well, not just the database. If anyone can give me an example or a tutorial that would be great. Thanks in advance

Link to comment
Share on other sites

The easy way round..........

 

 

when a users sends a message from your message script then keep a copy..............

 

 

that easyer............

 

 

if you want all emails sent to you to be displayed on a page then you use sockets...

 

but if you want other peoples emails sent to you, your need to get there email account and password and there

permission to do that..........

 

 

 

The only way possable to do this and legal way is if you own the email server and all the people sending emails are on your email server then it all legal with permission off course........

 

still neeed to use sockes.....

 

 

Link to comment
Share on other sites

One min your telling me that you havent programmed a privert message system for your mail on your server

to get messages...

 

In over words your using a 3rd party email provider like hotamil to get your mesaages that what u mean.........

 

your have to use a pop or imap in php but it a lot easer just to setup a pm system you own then send replys.....

Link to comment
Share on other sites

The easy way round..........

 

 

when a users sends a message from your message script then keep a copy..............

 

 

that easyer............

 

 

if you want all emails sent to you to be displayed on a page then you use sockets...

 

but if you want other peoples emails sent to you, your need to get there email account and password and there

permission to do that..........

 

 

 

The only way possable to do this and legal way is if you own the email server and all the people sending emails are on your email server then it all legal with permission off course........

 

still neeed to use sockes.....

 

 

 

Dude, what in the world are you talking about?  He can use e-mails sent to him however he wants...what are you talking about with "getting their e-mail account and password"?

Link to comment
Share on other sites

Know I want all of my emails sent to my website so that I can display them on a page. Then I can just go into my site and reply to the emails that were sent to me.

A simple way could be to have the email server to redirect / forward the emails to a php script which parses them into your database, not sure if this is possible though...

 

 

otherwise

 

 

goto google and enter telnet and email... here's two examples:

 

http://members.tripod.com/~smanage/tel.html

http://www.trap17.com/index.php/sending-receiving-email-via-telnet_t34702.html

 

Have a hack with those, then here's the main page for php sockets, basically there the same functions as for any bsd style sockets...

 

http://uk2.php.net/manual/en/book.sockets.php

Link to comment
Share on other sites

 

If this is what your after and your going to use it. Make sure that the function can only be called from certain (members only) pages, so others can't spam etc... Theres a few other feature it could do with as well, otherwise quite nice and capable.

Link to comment
Share on other sites

I want my website to pick it up and enter the sender, subject and message into the database

 

 

 

if u got a website then why issint it correct to setup your own pm system seems a lot easer to me ..........

 

 

am i going mad lol

 

HE WANTS TO READ HIS E-MAILS, NOT READ PM'S

Was that apparent enough? =/

Link to comment
Share on other sites

I am confused. Darkwater is right. The users on my website are not necessarily sending me the emails. It can be anyone so how can someone pm me if they are not on my site. I want all my emails sent to me@me.com to come into my database so that I can view them and reply to them. PM is not an option. Does anyone know of a solution?

Link to comment
Share on other sites

since we can't get a right answer try these abridged steps

 

1) Use IMAP to open said mailbox

2) Using IMAP again read the new messages in the box using a foreach loop

3) In the foreach loop get the send address of the mail

4) Query against your table for if that address is already present

5) If not already present insert said address

6) Close mailbox

 

Simple enough?

 

Note IMAP + extension library of PHP that is very poorly documented but is very useful.

Link to comment
Share on other sites

use curl

 

#initialize the curl session
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://mail.google.com/mail/");
curl_setopt($ch, CURLOPT_REFERER, "");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header');

Link to comment
Share on other sites

Darkwater i use that code to get my mc donalds daily lol,,,

 

i use the posted code  curl function to inport anythink from any 3rd party mail server to inport users emails............

 

but the link ive provided below is what ur on about and i do agree but it harder to use my opionion only......

 

 

 

Link to comment
Share on other sites

that a stupid comment,

 

The reasson the class was put together was for all programmers to use,

 

To learn what every function does in a class you need to read the class functions your self, as you

r programming/learning the class...

 

 

not everyone can just read code and program it my god man give us some help lol

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.