Jump to content

Search the Community

Showing results for tags 'php email mysql contents'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. How can I make it so when I e-mail for e.g. news@example.com text/information of the e-mail is written into a mysql table? It would extract the contents of a new email and write them into MySQL table. This table manages news articles on the website, so in the MySQL columns:"content" is the body of the message"caption" is the title of the news article"snippet" is the title that will appear in a "Latest News" block"uri""date" is the date the article is posted." $subject = caption = uri $message = content = snippet(first two lines of content) $date = date (in Unix timestamp) The table is named bx_news_entries manages the news articles visibly.I researched and saw a user who posted this on stackoverflow who's code looked like so: <?php$imap = imap_open("{gmail.com}", "username", "password"); if( $imap ) { //Check no.of.msgs $num = imap_num_msg($imap) //if there is a message in your inbox if( $num >0 ) { //read that mail recently arrived echo imap_qprint(imap_body($imap, $num)); } //close the stream imap_close($imap);}?> We are using an exchange server..I am a coop student so I am not really advanced at this. I tried this as a test to see if it works, logging in gmail to read email. It didnt work. <?php // connect to the mailbox$m_mail = imap_open("{mail.https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&ltmpl=default&ltmplcache=2}INBOX", "username", "password"); //get all messages$m_search=imap_search ($m_mail, 'ALL '); // Order results starting from newest messagersort($m_search); //loop through and do what's necessaryforeach ($m_search as $onem) { //get imap header info for obj thang $headers = imap_headerinfo($m_mail, $onem); $head = imap_fetchheader($m_mail, $headers->Msgno); $body = imap_body($m_mail, $headers->Msgno, FT_INTERNAL ); echo $body; } //purge messages (if necessary)imap_expunge($m_mail); //close mailboximap_close($m_mail); ?> I have the code imagined in my head, i just need to bring it to fruition.Can somebody assist me with this please?
×
×
  • Create New...