RE: [PHP] Parse an email message for content

2002-06-10 Thread Lazor, Ed

You'll need to have a cgi version of PHP to use in cronjobs and you'll need
to use http://www.php.net/manual/en/function.preg-grep.php

Good luck =)

-Original Message-
From: Jonathan Duncan [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 12:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Parse an email message for content


I am trying to display on a web page a daily message from a mailing list
that I am on.  What I want is to have a script run on my server each day at
a certain time that reads the mail file that contains the daily email
message, takes the Article Titles and makes them the link text to be used
with the link that is provided and then have the article abstract listed
below.

Can anyone point me in the correct direction on how I can learn how to do
this?

Thank you very much,
Jonathan Duncan

The daily email message I get comes in the following format:

*-*-*-* Start Email Message *-*-*-*
EMAIL HEADERS

Bulleted list of article titles
-article 1
-article 2

=  (That is 5 equal characters)

Article 1 Title
See http://some.server.com/path/to/article.html
 a href=http://some.server.com/path/to/article.html;Link/a
See http://additional.server.com/path/to/article.html
 a href=http://additional.server.com/path/to/article.html;Link/a

Article 1 abstract.  This gives a brief excerpt of the article.

=  (That is 5 equal characters)

Article 2 Title
See http://some.server.com/path/to/article.html
 a href=http://some.server.com/path/to/article.html;Link/a
See http://additional.server.com/path/to/article.html
 a href=http://additional.server.com/path/to/article.html;Link/a

Article 2 abstract.  This gives a brief excerpt of the article.

-
Copyright text ends the message



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Parse an email message for content

2002-06-10 Thread Jonathan Duncan

Ed,

Thanks for the reply.  Actually, I have the module version and the cgi
version of PHP running on my server.  I have another script that I run
daily, but that is a different beast with my own content.  Also, I know
about egrep and preg_egrep, great functions.  However, I am looking for an
idea on how to actually read the email files.

I have been reading about fread for reading the file and then I have
considered doing an fseek to start reading where the email headers stop,
and then explodeing the contents of the file separated by the =
delimiter that comes in the message.  However, I do not know where to start.
Any pointers?

Thanks,
Jonathan Duncan


Ed Lazor [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You'll need to have a cgi version of PHP to use in cronjobs and you'll
need
 to use http://www.php.net/manual/en/function.preg-grep.php

 Good luck =)

 -Original Message-
 From: Jonathan Duncan [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 10, 2002 12:48 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Parse an email message for content


 I am trying to display on a web page a daily message from a mailing list
 that I am on.  What I want is to have a script run on my server each day
at
 a certain time that reads the mail file that contains the daily email
 message, takes the Article Titles and makes them the link text to be used
 with the link that is provided and then have the article abstract listed
 below.

 Can anyone point me in the correct direction on how I can learn how to do
 this?

 Thank you very much,
 Jonathan Duncan

 The daily email message I get comes in the following format:

 *-*-*-* Start Email Message *-*-*-*
 EMAIL HEADERS

 Bulleted list of article titles
 -article 1
 -article 2

 =  (That is 5 equal characters)

 Article 1 Title
 See http://some.server.com/path/to/article.html
  a href=http://some.server.com/path/to/article.html;Link/a
 See http://additional.server.com/path/to/article.html
  a href=http://additional.server.com/path/to/article.html;Link/a

 Article 1 abstract.  This gives a brief excerpt of the article.

 =  (That is 5 equal characters)

 Article 2 Title
 See http://some.server.com/path/to/article.html
  a href=http://some.server.com/path/to/article.html;Link/a
 See http://additional.server.com/path/to/article.html
  a href=http://additional.server.com/path/to/article.html;Link/a

 Article 2 abstract.  This gives a brief excerpt of the article.

 -
 Copyright text ends the message



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Parse an email message for content

2002-06-10 Thread Lazor, Ed

Exploding at the = is a good idea.  I'd just fread the file into a
variable, explode it, and then egrep up to the first delimeter.  I'm not
sure if this is the best approach... but it's the most likely approach I'd
take if I were working on this. =)

---
I am looking for an idea on how to actually read the email files.

I have been reading about fread for reading the file and then I have
considered doing an fseek to start reading where the email headers stop,
and then explodeing the contents of the file separated by the =
delimiter that comes in the message.  However, I do not know where to start.
Any pointers?

 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Parse an email message for content

2002-06-10 Thread Michael Geier

while not documented, PHP now has the mail-parse functions (see
documentation for function list)

 -Original Message-
 From: Jonathan Duncan [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 10, 2002 3:48 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Parse an email message for content


 Ed,

 Thanks for the reply.  Actually, I have the module version and the cgi
 version of PHP running on my server.  I have another script that I run
 daily, but that is a different beast with my own content.  Also, I know
 about egrep and preg_egrep, great functions.  However, I am looking for an
 idea on how to actually read the email files.

 I have been reading about fread for reading the file and then I have
 considered doing an fseek to start reading where the email headers stop,
 and then explodeing the contents of the file separated by the =
 delimiter that comes in the message.  However, I do not know
 where to start.
 Any pointers?

 Thanks,
 Jonathan Duncan


 Ed Lazor [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  You'll need to have a cgi version of PHP to use in cronjobs and you'll
 need
  to use http://www.php.net/manual/en/function.preg-grep.php
 
  Good luck =)
 
  -Original Message-
  From: Jonathan Duncan [mailto:[EMAIL PROTECTED]]
  Sent: Monday, June 10, 2002 12:48 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Parse an email message for content
 
 
  I am trying to display on a web page a daily message from a mailing list
  that I am on.  What I want is to have a script run on my server each day
 at
  a certain time that reads the mail file that contains the daily email
  message, takes the Article Titles and makes them the link text
 to be used
  with the link that is provided and then have the article abstract listed
  below.
 
  Can anyone point me in the correct direction on how I can learn
 how to do
  this?
 
  Thank you very much,
  Jonathan Duncan
 
  The daily email message I get comes in the following format:
 
  *-*-*-* Start Email Message *-*-*-*
  EMAIL HEADERS
 
  Bulleted list of article titles
  -article 1
  -article 2
 
  =  (That is 5 equal characters)
 
  Article 1 Title
  See http://some.server.com/path/to/article.html
   a href=http://some.server.com/path/to/article.html;Link/a
  See http://additional.server.com/path/to/article.html
   a href=http://additional.server.com/path/to/article.html;Link/a
 
  Article 1 abstract.  This gives a brief excerpt of the article.
 
  =  (That is 5 equal characters)
 
  Article 2 Title
  See http://some.server.com/path/to/article.html
   a href=http://some.server.com/path/to/article.html;Link/a
  See http://additional.server.com/path/to/article.html
   a href=http://additional.server.com/path/to/article.html;Link/a
 
  Article 2 abstract.  This gives a brief excerpt of the article.
 
  -
  Copyright text ends the message



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Parse an email message for content

2002-06-10 Thread Jonathan Duncan

Michael,

Wow, correct you are:

http://www.php.net/manual/en/ref.mailparse.php

Thank you, I will definitely see what that has to offer me.

Jonathan Duncan


Michael Geier [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 while not documented, PHP now has the mail-parse functions (see
 documentation for function list)




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Parse an email message for content

2002-06-10 Thread Lazor, Ed

Which documentation should we check to get information on the undocumented
features? ;)

ps... I'm joking.

-Original Message-
while not documented, PHP now has the mail-parse functions (see
documentation for function list)
 

This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.   

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php