Php Mail Logging

Discussion in 'PHP' started by sohail.rahman, Nov 13, 2008.

  1. #1
    Hi Every One

    Well I m badly stuck in this concept and i didnt find any help.
    My problem is that I want to log all the emails that employees send in my organization in a database on the server or any other computer in LAN(as all computers are interconnected).
    I am enough good in php basics but this task is really very advance and I m stuck here.

    Can sombody plz help me out????

    I really need it

    plzzzzzzzzz if you can do anything..........

    Best Regards
    sohail:)
     
    sohail.rahman, Nov 13, 2008 IP
  2. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #2
    what kind of software are you using to run your email mail server?
     
    javaongsan, Nov 13, 2008 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    look for the function mail()

    if(mail())
    {
    insert into database
    }
    if mail is sent then insert to your logs
     
    bartolay13, Nov 13, 2008 IP
  4. penalty

    penalty Member

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #4
    thats not that easy.
    first, which mail server is your company running?

    second, you need to find out, how you can get your programm executed by the mailserver.

    for example: i used postfix as a mailserver and wrote a vacation script, which checks if a email-address is on vacation or not (this data was set by the user on a webinterface). all you have to configure is that when a certain circumstance happens, the mailserver should forward it to your external program.
     
    penalty, Nov 14, 2008 IP
  5. sohail.rahman

    sohail.rahman Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    hi bartolay13

    the method you told me is very easy for me . and I used it alot like

    if(mail($to,$subject,$message,$headers))
    {
    $msg = "Mail has been sent . . . !";
    }
    else
    {
    $msg = "Sorry , Some unknown error while trying to send mail . . . !";
    }

    but this is not my problem. my problem is "My employees will use 'www.yahoomail.com' to login to thier yahoo accounts and then send mails from that browser. those mails i want to log."
    And by the way I m not idiot. I am a beginer of PHP but I am very Good according my level.
    I m fresh graduate worked in php just 2 months.
    plz if you can help me in my problem.
    thaks 4 reply
    sohail
     
    sohail.rahman, Nov 16, 2008 IP
  6. sohail.rahman

    sohail.rahman Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hello EveryBody...!

    Let me make the problem very clear
    the problem is:
    "I have about 50 computers in my office and all the employees user Iexplorer and Firefox to login to thier email acconts on yahoo , or Gmail etc from www.yahoo.com or www.gamil.com. Now when they send emails after loging In in such a way, I want thier emails to pass through a filter like Emails cant have digits , now if an email has digits the email will not send and will be logged in DB."

    This is problem. Plz if any one can help.

    Kind and Best Regards
    Sohail
     
    sohail.rahman, Nov 16, 2008 IP