Re: [PHP-DB] Re: php mail() question
Change this: echo "",HtmlSpecialChars($headers[$line]),"'"; For echo "".HtmlSpecialChars($headers[$line])."'"; Which should display. I tried this a few days ago. All it outputs is the "PRE" HTML tags. even replacing the ',' with '.' . That's what I thought would need to be done to get it to work. But it won't display it however it displays in in plain text out of the box. Feel free to download and try the script yourself. You can find the address from my previous posts on this message board. Something is obviously blocking it for going into a text box as someone mentioned once before. The author is refusing to help maybe because the author does not know a fix. Which is odd, they wrote the script and claim they use a similar method to handle their mailing list bounces. Doubtful. Anyways, I have been redirected to try using "SMTP" connection. Does anyone know much about this usage? J http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: php mail() question
Change this: echo "",HtmlSpecialChars($headers[$line]),"'"; For echo "".HtmlSpecialChars($headers[$line])."'"; Which should display. I tried this a few days ago. All it outputs is the "PRE" HTML tags. even replacing the ',' with '.' . That's what I thought would need to be done to get it to work. But it won't display it however it displays in in plain text out of the box. Feel free to download and try the script yourself. You can find the address from my previous posts on this message board. Something is obviously blocking it for going into a text box as someone mentioned once before. The author is refusing to help maybe because the author does not know a fix. Which is odd, they wrote the script and claim they use a similar method to handle their mailing list bounces. Doubtful. Anyways, I have been redirected to try using "SMTP" connection. Does anyone know much about this usage? Cheers! http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: php mail() question
> What does this do? Well I added and for > a testing purpose. > > It returns in the textarea ... > > So it's skipping the HtmlSpecialChars code. Why? Change this: echo "",HtmlSpecialChars($headers[$line]),"'"; For echo "".HtmlSpecialChars($headers[$line])."'"; Which should display. -- Mike Karthauser Managing Director - Brightstorm Ltd Email >> [EMAIL PROTECTED] Web >> http://www.brightstorm.co.uk Tel >> 0117 9426653 (office) 07939 252144 (mobile) Snailmail >> Unit 8, 14 King Square, Bristol BS2 8JJ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hi, Okay removed "value" and have this now: ---some code--- echo ""; echo "",HtmlSpecialChars($headers[$line]),"'"; echo ""; ---some code--- What does this do? Well I added and for a testing purpose. It returns in the textarea ... So it's skipping the HtmlSpecialChars code. Why? Okay if I have this: ---some more code--- echo ""; echo "$headers'"; echo ""; ---some more code--- It returns in the textarea the following: Array So it appears to display if I don't use ",,". I guess there is no easy way to define $headers to diaply the entire headers when it's used? I quote you: Text areas do not take any value attributes. Well they do... If I use value="whatever" it returns that in the box. (well did for me) I posted on another board regarding the issue and they told me to contact the author of the script. (which is you I believe) They also seeked some sniplets which I sent onto them and they said ti SHOULD work. But I only gave them a sniplet of it and gave them the url for the script. They believe something is blocking the break out from the textarea so when you break out of it to use a function it returns nothing. But if you don't break out and use $headers it returns a value. Please check the script and see if there is something blocking a breakout. I'll look into this though, it seems odd to me but I suggest you contact the author as they would know the problem. (hence they wrote it) If the author fails to help let me know, I'll look into it. But 9 times out of 10 they will assist unless they have copied it off somewhere or don't have alot of time. He than went on about some things than ended with... It only looks like a simple thing, you've probably done some miss typing so should only take a few minutes to find the error and might only be in your form so ask the author. I am continuely replying to their comments to resolve this problem. But they keep insisting me to contact the author. Anyways since they claim it's something easy or miss typed I think $4 or $5 is applicable to fix this. Not a job many would expect payment from I am sure. Probably a 30 second job, that is why I posted here. Not as if I need something high techy. When I first posted you directed me to the pop3. Yes I grabbed it.. Got some more help off you. Did some work to get a database setup and test against my live database for a match. Yep works fine. However I made it so you had to type in the email address to get the account flagged. So I got it all setup but now I want the headers to be displayed in the text box. Like it's displayed on screen for message 1. But I can't get anything like that in the text box. Since the return is an array and seems to ignore the other code. I have continuely followed up because you said you use this method to handle bounced emails for your mailing list. So obviously you use it somehow or another or a different method but your sending data to a database with the bounced email and handling it. SO how are you getting it here via a form? What info are you using to get the form to understand it. As I said before credit is given for all work with author, web address for script etc. That results in a much better return than $4 or $5 will. Cheers! --- This does not make sense. You need to understand what you are doing. Text areas do not take any value attributes. The text that will show must be entered between http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hello, On 12/22/2003 12:13 PM, Jerry wrote: You just need to call the RetrieveMessage function that returns the headers of each message and then look for the To: header. Ummm, why can't you give me a working code that grabs the headers and put it into a textarea? Hey, I can tell you how to fish, but it needs to be the one that will fish for yourself. Meaning, I have given you enough information for you to take the class and do what you need it to do. If you are having difficulties, maybe you just ask for help probably paying for the work. Sorry, I can't help you now, but here you may find solve your problem. http://www.php-freelancers.com/ echo ""; echo "'"; echo "\n"; echo ""; Results in the form area being blank. Replacing 'HtmlSpecialChars' with 'RetrieveMessage' comes back with an error saying it's not deinfed on line blah This does not make sense. You need to understand what you are doing. Text areas do not take any value attributes. The text that will show must be entered between -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
You just need to call the RetrieveMessage function that returns the headers of each message and then look for the To: header. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ Ummm, why can't you give me a working code that grabs the headers and put it into a textarea? echo ""; echo "'"; echo "\n"; echo ""; Results in the form area being blank. Replacing 'HtmlSpecialChars' with 'RetrieveMessage' comes back with an error saying it's not deinfed on line blah (which results back to the form line) But having the first code results in no errors, but a blank box. But why does it work outside the box fine as plain text? All I need is the code that actually shows up into a textarea or a simple input text box. Code would be ideal as I can't figure this out ... I can get it to output fine in plain text but when I try a form it does nothing. Another way I tried which I can't remember what I did now returned an array response. I'm not worried about sifting through and finding the To: address. I know how to do this. I have the database setup to handle that. Just can't seem to get the headers in a form box, that's all I require than it's all done. Just a small bit of code is stopping sucess. otherwise I'll opt to another method of handling this, probably end up more complicated but I was told that this way would be pretty easy but can't seem to get you to show a working text area displaying the text. What I can't understand is why can't a simple bit of code show the same results in a text box than in plain text? Something is stopping it, but does not seem to be a error because no error is outputed. Unless some errors are not displayed? Anyways... I'm at the stage at throwing all the code in because of this problem. I've spent a week or so on it. I could of got a Mailing List and do it all that way and handle all bounces but thought I'd try a way that at least I could run it the way I want it to run that adapts to my database instead of using one all setup to run on a certain database structure which I'd have to work right through to edit to get to work with mine. Thanks to those people that have assisted me, please reply to this thread to this board though so everyone is aware of what you suggest etc. So than we don't get multiple ideas floating my way. All is appreicated. :) And thanks again, credit on the site I am working this with will be given to all sucessful help as I do on all my sites. Cheers! http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hello, On 12/18/2003 10:44 AM, Jerry wrote: How do I list the headers that are ouputed in the page into the text area also? You just need to call the RetrieveMessage function that returns the headers of each message and then look for the To: header. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hi, Just to follow-up on this. I knuckled down and did some work regarding this thread. What I achieved makes things work a tad faster than previously however it did not work out as I wanted entily but has fastened the process somewhat but still have a question regarding it. I have managed to be able to flag accounts alot fast now using test_pop3.php and including a text field to enter a email address in and submit it to a tmp table for later use. That grab all emails out of the tmp file and flag accounts. Takes only about 5 seconds to complete and flag. However it's not what I had in mind. I'd prefer it to be automatic, without the need of me to input an address to flag it. I tried to inlcude a header in a textarea box but can't seem to find the right bit of code to inlcude in the value=' ' part of the form. :( When I tried I kept getting a 'Array' response in the box. Here's some code: echo "Message 1\n---Message headers starts below---\n"; for($line=0;$line",HtmlSpecialChars($headers[$line]),"\n"; echo ""; echo ""; echo ""; echo "---Message headers ends above---\n---Message body starts below---\n"; end I have tried value='HtmlSpecialChars($headers[$line])'> and value='$headers'> But Array is the response in the box. How do I list the headers that are ouputed in the page into the text area also? If I could achieve this I could than make things run virtually automatic. That's all I need to do now, the rest I have managed to accomplish very nicely thanks to some people. J http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
--- Actually I start a PHP script from the cron task that runs every 5 minutes using PHP CGI executable version. I just process upto 100 bounced messages per run avoid hogging the database server and blocking the POP3 mailbox for a long time, as this is not a prioritary task. --- Right, how do you get the address from the bounced email into the query? I know how to run a cronjob to update the database, I use 1 cronjob for the site currently that does all the tasks regarding accounts. Ran every 5 minutes to do updates, send emails etc. I guess I could run a cronjob to go into a temp table to log all the email contents than fetch the address back and flag the account. But thought I'd ask you how you get the bounced email to be ran in the query with the script? I am guessing some modifications need to be doen. This will be the last time I email regarding this matter to this list. So no answer is fine, I'll just run the long way about it. But thought you could, or someone, of pointed me in the right direction. But obviously your skipping my main question for some reason. Anways thanks for the help to date. Thanks in advance for any replies you give me also if you wish to reply. Jerry http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hello, On 12/16/2003 10:04 PM, Jerry wrote: Actually I just relised what you meant. :P And that would work great by having it like that.. Something like this would work fine. If the email bounces return it to [EMAIL PROTECTED] So I would set the sender as whatever I want and the return_path as a way to identify the user? Is that what you meant? That would mean I'd need a way to fetch the to: address from the pop3.php, how is this possible? At the pressent time I am doing everything manually. So I am going into the email and grabbing the address, doing a search on the database and when found flagging the account with abad email address. Quite time consuming when alot of bounces occours. So an automatic way to fasten up the process would be great. I don't mind if I have to activate the script manually. Just be great to have things moving along a bit faster than the pressent speed. Actually I start a PHP script from the cron task that runs every 5 minutes using PHP CGI executable version. I just process upto 100 bounced messages per run avoid hogging the database server and blocking the POP3 mailbox for a long time, as this is not a prioritary task. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Jerry, Actually I just relised what you meant. :P And that would work great by having it like that.. Something like this would work fine. If the email bounces return it to [EMAIL PROTECTED] So I would set the sender as whatever I want and the return_path as a way to identify the user? Is that what you meant? That would mean I'd need a way to fetch the to: address from the pop3.php, how is this possible? At the pressent time I am doing everything manually. So I am going into the email and grabbing the address, doing a search on the database and when found flagging the account with abad email address. Quite time consuming when alot of bounces occours. So an automatic way to fasten up the process would be great. I don't mind if I have to activate the script manually. Just be great to have things moving along a bit faster than the pressent speed. Jerry Hello, That's tricky. What I do is to have a catch-all mailbox for my site domain. So, every message sent to a mailbox that does not really exist will be dropped in that catch-all mailbox. When I send messages to each user, I make the return path address be set to something like [EMAIL PROTECTED] . For instance, messages sent to [EMAIL PROTECTED] by the PHP Classes site, will have the return path set to [EMAIL PROTECTED] . Since these address really do not exist, they will be dropped in the catch-all mailbox for that domain. So, all I need to do is to run a script that polls the POP3 mailbox of my catch-all account and parse the To: address of the bounced messages to figure the subscriber address that is bouncing. Not all bounce message will have the To: address set correctly. The remaining message should be ignored. http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hi, Are you using the test_pop3.php file that you showed me with the script that handles the bounced emails? If so, could you please show me a basic example of it working with it? My return_path is set as an email alias. (not a real address at the domain) [EMAIL PROTECTED] So that bounces to the 'root' email account. But if you could show me a basic example I could work with it. Coz I'll run a script to talk to the database and flag the account in question. I looked at the code but there is nothing in there that defines from: or anything. Another way I was thinking if there was a way to look in the $body of the email for an email address I thought perg_match would do something like that but maybe not? Is there a PHP matching function/command? So it coulds search for '@' in the email $body and skip the $headers. Jerry Hello, That's tricky. What I do is to have a catch-all mailbox for my site domain. So, every message sent to a mailbox that does not really exist will be dropped in that catch-all mailbox. When I send messages to each user, I make the return path address be set to something like [EMAIL PROTECTED] . For instance, messages sent to [EMAIL PROTECTED] by the PHP Classes site, will have the return path set to [EMAIL PROTECTED] . Since these address really do not exist, they will be dropped in the catch-all mailbox for that domain. So, all I need to do is to run a script that polls the POP3 mailbox of my catch-all account and parse the To: address of the bounced messages to figure the subscriber address that is bouncing. Not all bounce message will have the To: address set correctly. The remaining message should be ignored. http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hello, On 12/15/2003 10:23 PM, Jerry wrote: Thanks for that. That's hitting the nail right on the head. But I need a bit of PHP code to talk to mysql and only read the "from" part of the email and use a query to check the database if the entry is there. If it is than flag it, if not skip it and delete the email. So would I need to edit the code to make the from section a input form or can I somehow get a query to get the from data from plain text? All I want is the from address, the rest I don't really need. So UPDATE users SET flag='y' WHERE email='$from_address'; Might even output something to make sure it was sucessful or not. What I need to know is how I get the from address? That's tricky. What I do is to have a catch-all mailbox for my site domain. So, every message sent to a mailbox that does not really exist will be dropped in that catch-all mailbox. When I send messages to each user, I make the return path address be set to something like [EMAIL PROTECTED] . For instance, messages sent to [EMAIL PROTECTED] by the PHP Classes site, will have the return path set to [EMAIL PROTECTED] . Since these address really do not exist, they will be dropped in the catch-all mailbox for that domain. So, all I need to do is to run a script that polls the POP3 mailbox of my catch-all account and parse the To: address of the bounced messages to figure the subscriber address that is bouncing. Not all bounce message will have the To: address set correctly. The remaining message should be ignored. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hi, Thanks for that. That's hitting the nail right on the head. But I need a bit of PHP code to talk to mysql and only read the "from" part of the email and use a query to check the database if the entry is there. If it is than flag it, if not skip it and delete the email. So would I need to edit the code to make the from section a input form or can I somehow get a query to get the from data from plain text? All I want is the from address, the rest I don't really need. So UPDATE users SET flag='y' WHERE email='$from_address'; Might even output something to make sure it was sucessful or not. What I need to know is how I get the from address? Jerry --- Manuel Lemos <[EMAIL PROTECTED]> wrote: > Hello, > > On 12/14/2003 11:51 PM, Jerry wrote: > > Php mail() question. > > > > I use php mail() frequently, dragging data from a > > mysql database. I am not sure if this is possible > but > > thought I'd throw it on this board. > > > > in php mail() function you can set a > return_address > > etc. Is it possible to change this and run a > query? > > I mean if the email bounces can it somehow talk > back > > to php mail() and do a query rather than send it > to > > the return_address? > > If you make the bounce address point to a POP3 > mailbox, you have a > platform independent solution to handle bounces. > Then you just need to > use some POP3 component like this to fetch and > process the bounced > messages once in a while, for instance starting a > PHP script from a cron > task. I do this all the time to handle bounces from > newsletters that I > send from my site. > > http://www.phpclasses.org/pop3class > > -- > > Regards, > Manuel Lemos > > Free ready to use OOP components written in PHP > http://www.phpclasses.org/ > http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: php mail() question
Hello, On 12/14/2003 11:51 PM, Jerry wrote: Php mail() question. I use php mail() frequently, dragging data from a mysql database. I am not sure if this is possible but thought I'd throw it on this board. in php mail() function you can set a return_address etc. Is it possible to change this and run a query? I mean if the email bounces can it somehow talk back to php mail() and do a query rather than send it to the return_address? If you make the bounce address point to a POP3 mailbox, you have a platform independent solution to handle bounces. Then you just need to use some POP3 component like this to fetch and process the bounced messages once in a while, for instance starting a PHP script from a cron task. I do this all the time to handle bounces from newsletters that I send from my site. http://www.phpclasses.org/pop3class -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php