PHP Classes

Readattachment class

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Readattachment class  >  (Un) Subscribe thread alerts  
Subject:Readattachment class
Summary:I need help with the readattachment class.
Messages:19
Author:Carl Wuensche
Date:2008-08-06 00:07:53
Update:2009-08-19 18:42:05
 
  1 - 10   11 - 19  

  1. Readattachment class   Reply   Report abuse  
Picture of Carl Wuensche Carl Wuensche - 2008-08-06 00:07:54
I want to be able to have the variable of the message body of the incoming email, and then use a preg match to get values of the username and password they input.

Example:

Subject: Whatever
Message:
username: stuffradio
password: pass123

<attached image here>

That's what the email would look like essentially. How can I read the email body, and with regex get the value of the username and password?

  2. Re: Readattachment class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-08-06 00:22:45 - In reply to message 1 from Carl Wuensche
I am not sure what you mean. Is that an HTML message with an embedded image?

  3. Re: Readattachment class   Reply   Report abuse  
Picture of Carl Wuensche Carl Wuensche - 2008-08-06 00:59:00 - In reply to message 2 from Manuel Lemos
Someone sends an email to a gmail address. I am using the readattachment class to get the email.

I can successfully get the attachment from the email, but I want to be able to get the message, and get the username and password that they enter with regex.

I was showing you an example of what the email should look like. The attachment that I put in the text of my message is just a representation of the attachment of an image in the email that I will be parsing.

  4. Re: Readattachment class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-08-06 01:25:13 - In reply to message 3 from Carl Wuensche
I don't know about any readattachment class.

You can use the POP3 class in conjunction with the MIME parser class to get the message from Gmail POP3 server and then you make the message be parsed automatically by the MIME parser class.

phpclasses.org/pop3class

  5. Re: Readattachment class   Reply   Report abuse  
Picture of Carl Wuensche Carl Wuensche - 2008-08-06 01:28:54 - In reply to message 4 from Manuel Lemos
I'm referring to this

phpclasses.org/browse/package/2964. ...

  6. Re: Readattachment class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-08-06 01:55:15 - In reply to message 5 from Carl Wuensche
OK, but I did not develop that class, so I cannot help you with it.

The POP3 class I mentioned above it was developed by me, so I can help you to integrate with it.

Actually it comes with an example that is almost ready to read messages from Gmail and parse them in a way that is easy to process by applications.

  7. Re: Readattachment class   Reply   Report abuse  
Picture of Carl Wuensche Carl Wuensche - 2008-08-22 07:40:26 - In reply to message 6 from Manuel Lemos
Are you able to help me easily use this class instead of my previous one? My previous class works fine... but when I send an email from a mobile phone, it doesn't download the image properly. It only downloads a file called 'nfn2252.alternative'. So it's not decoding something properly.

I would prefer to use your class if it's easily doable because you actually provide support.

  8. Re: Readattachment class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-08-22 13:16:54 - In reply to message 7 from Carl Wuensche
Using this class is straightforward. Just try to use it and let me know if you have any difficulties.

  9. Re: Readattachment class   Reply   Report abuse  
Picture of Carl Wuensche Carl Wuensche - 2008-08-23 19:28:28 - In reply to message 8 from Manuel Lemos
I tried looking at the test classes... but I don't understand. It looks like it's forcing me to use a '.eml' file but I don't have that. I'm just parsing the emails in the inbox.

  10. Re: Readattachment class   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-08-23 20:24:44 - In reply to message 9 from Carl Wuensche
The example script test_message_decoder.php is ready to be run from the command line taking as argument the message file name.

If you do not specify any message file name or you run as a Web server script, you can change the default message file name in the script itself where it says test/sample/message.eml .

If you are accessing the messages from a POP3 server, you can also check the examples that come with the POP3 class that integrate with the MIME parser class to read messages directly from the server without having to store them in a file first.

phpclasses.org/pop3class


 
  1 - 10   11 - 19