Comments (5)
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 mailNow 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.
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.
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 mailNow 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.
👍
from php-imap.
@christatedavies curious to see if you have expanded on this function?
from php-imap.
Related Issues (20)
- [BUG] Why is the time to get the email previous? HOT 1
- [Feature Request] I Want to All Email in Directory and Spam Directory
- [Feature Request] Add Origin-MessageID header
- Couldn't open stream
- PHP Fatal error: Uncaught Error: Call to protected method PhpImap\Mailbox::disconnect()
- I need solution for convert emails to ticket
- Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure)PHP Notice: Unknown: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure) (errflg=2) in Unknown on line 0
- ConnectionException "LOGIN failed." with office 365 since Microsoft activated two factor auth HOT 2
- [Feature Request] Add bool return to setFlag(), markMailAsRead(), etc. HOT 2
- fetch_overview does not allow select range with * HOT 1
- [BUG] Embeded images get replaced nok HOT 1
- [BUG] Processing ENCBINARY encoding returned base64 string
- [BUG] For some emails, the body is empty HOT 3
- Error Handling Not working
- where is vendor folder HOT 7
- [BUG] Mark as Seen boolean not working on getMail() HOT 1
- imap_fetchheader(): UID does not exist HOT 2
- [Feature Request] Save email to eml file
- SEEN SINCE Issue
- OFFICE 365 - Connection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-imap.