beidlerj
-
Posts
7 -
Joined
-
Last visited
Never
Posts posted by beidlerj
-
-
Hello,
I am having trouble getting any results back from the imap_search function. I assume it has to do with getting the right query string.
I am grabbing a string of keywords from an HTML form input box, and (trying to) search the IMAP inbox for messages which contain the $keywords string in either the BODY or the SUBJECT. Can anyone lend some help with the correct string to send to the server? I keep getting nothing back, meaning that the server doesn't understand the query.
$link = imap_open($server, $UN, $PW) or die(imap_last_error()); $matches = imap_search($link, "BODY \"$keywords\" SUBJECT \"$keywords\""); if ($matches === false) { echo "Server didn't understand query.<p>"; echo imap_last_error(); }
Thanks,
Jeff
-
I figured out what you were getting at, a couple days after the fact. Must have been short on sleep then...
I was able to get images to display without storing them first. Just did a simple show script that kicks out the content-type header and the image, but can be referenced in the <img> tag as the source... basically like returning a file, but just a stream of data.
Thanks for the help.
-
Thanks for the reply.
Actually, I'm looking for a way to display messages that are read from an IMAP server, without needing to dismantle/store the various parts in a database. Just read and display, like any ol' webmail. I tried looking at the code for a few apps like SquirrelMail, but couldn't make heads or tails of it. It's pretty complex. I just want to do something very very simple, so I can understand how it works.
-
If I simply output the file using readfile() or something like it, how does the web browser know that the data is for use as the cid:blahblah image? I know I could use header() to add "Content-Type" image/whateveritis", "Content-Disposition: inline", etc., but what should I use in the "filename" parameter of "Content-Disposition"? Would it be the actual name of the file, or the ID parameter, which is referenced in the HTML code (<img src="cid:blahblah">)?
Thanks, hope someone can help. Much appreciated!
JEff
-
Hello,
I am attempting to understand PHP's email functions and writing my own simple mail display script. I have so far been able to snag the HTML part of email messages, but I'm having trouble with inline images contained in a message. I can figure out which body part contains the image, and I can load the data from the message into a variable, decoding/converting as need be. What I can't figure out, though, is how to get the image to display in the browser when I echo the HTML message body.
Here's the way I've been approaching the problem thus far:
1. Use imap_fetchstructure to get info on a message.
2. Analyze the parts to find body part numbers for the HTML and the image(s).
3. Echo the HTML to the browser.
The HTML sent to the browser contains <img src="cid:bunchanumbers">. How do I get the image to show up in that spot?
Thanks muchos,
Jeff
-
How about PHP-GTK books? The only one that turns up on Amazon/Borders is written in Portugese... there must be some more out there somewhere! I've had a hard time even finding many (good) tutorials on the web, other than your standard "Hello, World!"
imap_search
in PHP Coding Help
Posted
If I only try this code:
I get an array of msg IDs that matched. However, when I try this code:
...then the function returns false. Is this a problem with the implementation, or is there some other "magic phrasing" I need to use, in order to search the body of messages for a keyword?