Jump to content

cute_girl

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cute_girl's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Dear friends: anyone know how to use these? I want to read my inbox and after that I want to save my all messages in INBOX to DRAFT folder. I just want to know that what should be in parameters? $location = "DRAFTS"; //what should be here? exact name of draft imap_mail_move($mbox, $msg_no, $location); //how t o find msg numbers???? thanks in advance....
  2. <?php //Connection $mbox=imap_open("{mail server}","user","paswd") or die("Error! Couldn't Connect"); //read header informations $msg=imap_mailboxmsginfo($mbox); //sort messages by date $message_count = imap_num_msg($mbox); $messages = imap_sort($mbox, SORTDATE,0); //function to extract domain from messages function extract_domains_from($string){ preg_match_all("/(http:\/\/[a-zA-Z0-9._%-?&\/:]+)/i", $string, $matches); return $matches[0]; } //Loop to display Message Subject, Domain Name and Files foreach ($messages as $message) { for ($i = 1; $i <= $message_count; ++$i) { //printing subjects $header = imap_header($mbox, $i); echo "<br>"; print "<b>".$header->Subject."</b>"; //finding bodies $header = imap_header($mbox, $i); $body = trim(substr(imap_body($mbox, $i), 0)); //function calls to extract domain from message $domainss = extract_domains_from($body); echo "<br>"; //Joined all domains and the print $allurls=(implode(" ",$domainss)); echo "<br><br>"; //Print single URL $emailmsg=$allurls; $singleurl=(explode(" ",$allurls)); $size = count($singleurl); echo "<br><br>"; for ($u=0; $u<$size; $u++) { $spliturl=(explode("?",$singleurl[$u])); echo "<br>".$spliturl[0]."<br>"; } echo "<br><br>"; for($p=0; $p<$size; $p++) { echo "<br><br>"; $emailmsg=$singleurl[$p]; //Removing Last part from URL if (eregi("http://", $emailmsg)) { $emailmsg = explode("http://", $emailmsg); $emailmsg = array_reverse($emailmsg); $domain = $emailmsg[0]; $domain = explode(".", $domain); if ($domain[0] == "www") { $var=explode("/",$domain[2]); $extracted = $domain[1].".".$var[0]; echo $extracted; } else { $var=explode("/",$domain[1]); $extracted = $domain[0].".".$var[0]; echo $extracted; } } } //printing from email address $header = imap_header($mbox, $i); $from = $header->from; foreach ($from as $id => $object) { $fromaddress = $object->mailbox . "@" . $object->host; echo "<br><br><u>".$fromaddress."</u>"; } echo "<br><br><br><br>-------------<br><br>"; } } ?>
  3. Sorry 1st post was mistakenly posted before completing my question...and thanks @master, i will now use code tags Friends... I am using IMAP functions in PHP. I want to access Email Server, read all messages in INBOX then display each message subject, its body(contents), and sender Email Address. After doing it, I want to seperate those messages which contain URLs having specific files only, not all URLs. After this I want to display only URLs having those files (v.php & u.php only) in those messages, not complete message. Final output should be like this.... 1. Message Subject http://www.domain.com/u/v.php?id=1&id2=4 a. v.php b. u.php From: sender@mail.com 2. Message Subject2 http://www.domain2com/u/v.php?id=1&id2=4 a. v.php b. u.php From: sender2@mail.com | | | N. Message Subject N http://www.domainN.com/u/v.php?id=1&id2=4 a. v.php b. u.php From: senderN@mail.com and so on...(Looped) The problem with me is that, I cant manage all these, I wrote code, but as I am new to PHP, I m mixed up. I am pasting code in next post, which can access INBOX, display each message Subject, URLs from message and From address. but there some problem in nested looping. but it finds me just URLs not URLs of that specific files.. I know I m asking too much and even I mixed u people too. but if some one know this, then kindly help me, my project manager is asking me to complete the task quickly.
  4. Friends... I am using IMAP functions in PHP. I want to access Email Server, read all messages in INBOX then display each message subject, its body(contents), and sender Email Address. After doing it, I want to seperate those messages which contain URLs having specific files only, not all URLs. After this I want to display only URLs having those files (v.php & u.php only) in those messages, not complete message. Final output should be like this.... 1. Message Subject http://www.domain.com/u/v.php?id=1&id2=4 a. v.php b. u.php From: sender@mail.com 2. Message Subject2 http://www.domain2com/u/v.php?id=1&id2=4 a. v.php b. u.php From: sender2@mail.com <?php //Connection $mbox=imap_open("{mail server}","user","paswd") or die("Error! Couldn't Connect"); //read header informations $msg=imap_mailboxmsginfo($mbox); //sort messages by date $message_count = imap_num_msg($mbox); $messages = imap_sort($mbox, SORTDATE,0); //function to extract domain from messages function extract_domains_from($string){ preg_match_all("/(http:\/\/[a-zA-Z0-9._%-?&\/:]+)/i", $string, $matches); return $matches[0]; } //Loop to display Message Subject, Domain Name and Files foreach ($messages as $message) { for ($i = 1; $i <= $message_count; ++$i) { //printing subjects $header = imap_header($mbox, $i); echo "<br>"; print "<b>".$header->Subject."</b>"; //finding bodies $header = imap_header($mbox, $i); $body = trim(substr(imap_body($mbox, $i), 0)); //function calls to extract domain from message $domainss = extract_domains_from($body); echo "<br>"; //Joined all domains and the print $allurls=(implode(" ",$domainss)); echo "<br><br>"; //Print single URL $emailmsg=$allurls; $singleurl=(explode(" ",$allurls)); $size = count($singleurl); echo "<br><br>"; for ($u=0; $u<$size; $u++) { $spliturl=(explode("?",$singleurl[$u])); echo "<br>".$spliturl[0]."<br>"; } echo "<br><br>"; for($p=0; $p<$size; $p++) { echo "<br><br>"; $emailmsg=$singleurl[$p]; //Removing Last part from URL if (eregi("http://", $emailmsg)) { $emailmsg = explode("http://", $emailmsg); $emailmsg = array_reverse($emailmsg); $domain = $emailmsg[0]; $domain = explode(".", $domain); if ($domain[0] == "www") { $var=explode("/",$domain[2]); $extracted = $domain[1].".".$var[0]; echo $extracted; } else { $var=explode("/",$domain[1]); $extracted = $domain[0].".".$var[0]; echo $extracted; } } } //printing from email address $header = imap_header($mbox, $i); $from = $header->from; foreach ($from as $id => $object) { $fromaddress = $object->mailbox . "@" . $object->host; echo "<br><br><u>".$fromaddress."</u>"; } echo "<br><br><br><br>-------------<br><br>"; } } ?>
  5. @unsider thanks, u told me good way to list my forum features. and regarding my user name, should i change it, if u think that i m not cute?? lolzz. anyhow thanks so much.....
  6. hmmm lets try, i also want to be 100% in regex......  :-\
  7. @effigy thanks for ur help, but actually i need PHP script, and also i want a regex which must work on all types of URLs. once again thnx.
  8. @chrisdburns thanks so much for ur help. and i m agreed to @Crayon Violent. i m not a good writer. i can just code which cant be understandable by anyone, Lolzz. thanks to all....
  9. Dear friends. Can any one help me to find out URLs from mail message. I am using IMAP functions to retrieve mails. I searched many regex but couldnt get valid regex. for example: i have email message like this. this is new mail message. this is link in email http://www.domain.com/u/file.php?id1=1&id2=2&id3=3 please get this url from email message and now new url is http://hello.com/v.php?i=3 email is ended. now i want to display only http://www.domain.com/u/file.php?id1=1&id2=2&id3=3 http://hello.com/v.php?i=3 after doing this i want tol find out specific file in these urls i.e. v.php actually i want to display only those urls which contains v.php which is http://hello.com/v.php?i=3 I just need guidence. I tried alot but failed. thanks
  10. Dear actually u people dont understood what I want to ask. I know how to make Forum using PHP and also know using it. Actually I want that I include a short summary of all the features of my Forum in my Resume. There are many functionallities and I dont know what should be include and what should not. thnx
  11. Dear Barand thanks for ur reply but???????????
  12. plzzzz reply, I need it urgent.
  13. Dear Friends I am new to this Forum. I done recently my Bachelor in Computer Science and My Final Year Project Title is "An Online Discussion Forum/Board". I complete my project successfully using PHP/MySQL. Now I have a problem in making my Curriculum Vitae / Resume. I applied for a job and they want my CV with a 4 or 5 lines detail about my project, like summary of my project i.e. I wrote simple "An Online Discussion Forum" using PHP / MySQL. Now I know what is in my project but I cant summarize it in 4 or 5 lines. I dont know what should be include and what should not.... please if anybody help me I will be very thankful to him/her. My Forum have following features... Member Registration (Activation required via email) Member Approval by the Admin Only Registered member after Login in can post or reply to a topic. Admin Area where Admin can manage all the forums. An admin can block a user or delete or edit a post. there also subforums... in short all the common features that every forum should have... Please if some one make me a 4 or 5 lines summary in good words 2 me, so i will include it in my Resume.... Thanks so much...
×
×
  • 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.