GithubHelp home page GithubHelp logo

Comments (5)

christatedavies avatar christatedavies commented on August 22, 2024

I have written an email importer that strips out old email parts but I have to admit it was a terrifically tedious task. I'm still not finished but it basically involves a bunch of string stripping functions. Some use regex to find strings like "on {date} a person wrote" and out of office ness and some just use stripos()

I don't think you'll ever be 100% perfect so my big piece of advice (if importing emails into a database) is to keep a copy of the entire original email.

Saying all that though, this class made it a lot easier as I didn't have to deal with the email parts, like I did previously.

I'll dig out some of the code for you when I get into the office.

Chris

On 1 May 2014, at 02:00, dejan7 [email protected] wrote:

Consider this scenario:
A) I send email to [email protected]
B) He replies to my mail

Now in that email that i received using your class i have in $email->textPlain:

Hello this is a reply from [email protected]
Lorem ipsum.

On 2015/0723/ dejan7 said:

this is the first email
i sent to [email protected]
Is there any way to get only contents of the message i.e.:

Hello this is a reply from [email protected]
Lorem ipsum.
?

Is it somehow stored in email parts? The problems is that different clients mark the old emails differently. Some use > and some use } etc. etc. Also some include the line "On 2015/0723/ dejan7 said:" in various formats or don't include it at all!

Great class BTW, it works great, i'm just wondering if this is somehow possible. Thanks!


Reply to this email directly or view it on GitHub.

from php-imap.

christatedavies avatar christatedavies commented on August 22, 2024

So, this is the main function I use: http://pastebin.com/J0R5aCR1

I basically get the body from the imap object and then use that function to return a string. Its not perfect by any stretch of the imagination, but its a continuous piece of work. There are also a couple of extra functions at the bottom that you can comment out.

from php-imap.

dejan7 avatar dejan7 commented on August 22, 2024

Wow thanks a lot man, you are awesome! You made my day! :) I'll check it
out later, when i get back home!
01.05.2014. 07.41, "christatedavies" [email protected] је
написао/ла:

I have written an email importer that strips out old email parts but I
have to admit it was a terrifically tedious task. I'm still not finished
but it basically involves a bunch of string stripping functions. Some use
regex to find strings like "on {date} a person wrote" and out of office
ness and some just use stripos()

I don't think you'll ever be 100% perfect so my big piece of advice (if
importing emails into a database) is to keep a copy of the entire original
email.

Saying all that though, this class made it a lot easier as I didn't have
to deal with the email parts, like I did previously.

I'll dig out some of the code for you when I get into the office.

Chris

On 1 May 2014, at 02:00, dejan7 [email protected] wrote:

Consider this scenario:
A) I send email to [email protected]
B) He replies to my mail

Now in that email that i received using your class i have in
$email->textPlain:

Hello this is a reply from [email protected]
Lorem ipsum.

On 2015/0723/ dejan7 said:

this is the first email
i sent to [email protected]
Is there any way to get only contents of the message i.e.:

Hello this is a reply from [email protected]
Lorem ipsum.
?

Is it somehow stored in email parts? The problems is that different
clients mark the old emails differently. Some use > and some use } etc.
etc. Also some include the line "On 2015/0723/ dejan7 said:" in various
formats or don't include it at all!

Great class BTW, it works great, i'm just wondering if this is somehow
possible. Thanks!


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/53#issuecomment-41882645
.

from php-imap.

barbushin avatar barbushin commented on August 22, 2024

👍

from php-imap.

surgiie avatar surgiie commented on August 22, 2024

@christatedavies curious to see if you have expanded on this function?

from php-imap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.