Problem using PHP imap functions -


I am trying to create an email message parser for our site if I receive a message from a specific email address, So what I am going to do through the message I save the attachment to attach.

This is just the preliminary exam, though, I am running into problems, see comments below.

  & lt ;? Phcho echo "Loading ...". "& Lt; br / & gt; \ n"; $ MailUser = "help@mysite.com"; "User = $ MailUser" resonate "" & lt; Br / & gt; \ N ";; $ Mailpass =" mypassword "; echo" pass = $ mailpass "." & Lt; Br / & gt; \ N "; // It has to be used because we have SSL on site and regular port 110 $ mailhost =" {localhost: 995 / pop3 / ssl / novalidate-cert} "does not work; echo" host = $ mailhost " . "& Lt; Br / & gt; $ Mailbox = imped_open ($ mailhost, $ mailuper, mailport) or die ("& lt; br / & gt; phalade!" .imap_last_error ()); $ check = imap_check ($ mailboxes); / / Last message will be parsed in the file msgcounter.dat $ firstmsg = file_get_contents ('msgcounter.dat') + 1; $ Lastmsg = $ firstmsg + $ check- & gt; recent; // == Previous message index + Counting the latest messages echo 'first:'. $ Firstmsg. '- last:' $ $ lastmsg. ' & Lt; br & gt; "; $ Result = imap_fetch_overview ($ mailbox, "$ firstmsg: $ lastmsg"); Print_r ($ result); {$ Overview- & gt; Subject} from {$ overview- & gt;}} - to: {$ overview-> Subject} n ";} // The following approach did not work either, // unanswered messages / warning message numbers / // some message sequences have been removed for warning * (* $ index = $ Falmams-1; $ Index & lt; = ($ last group); $ index ++) {if (strollon (trim (imp_fetchader ($ mailbox, $ index)) 1) {echo 'in message index loop:'. $ Index;}} * / Imap_close ($ mailbox); echo "complete." "& Lt; Br / & gt; \ N ";;?? & Gt;  

IMAP poor standards and the risk of worse implementations If you do not mind a little rude (or, er, a lot), then there is an infamous with some interesting insights.

You should probably consider doing dirty work.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -