What I want to do a mock-email-reader. This means I need to parse out the headers {I just need things like from/to/subject/date} and then find the "body" of the message. There seem to be three types of incoming emails one is plain text, another in plain html {that is no multipart but just HTML.. I got one just today:
and of course a multipart message {in which case I'd want the HTML part}.X-CMAE-Envelope: MS4xfLUIIc3gwFFCUTu1+RYnII5snX2pyaUrABakvIQ567LlL7RBF +Ly4Wo65N93eCIInGj50aDn6TLwhXwJbk7HKUHu2pUzH8OWeKTJoF2xE/w3tkTQrR8cj Kh4gBf/TMflzvBVgeRGN7++n/ZIwr/endxydKhxB1KRKrAoSBcA1O3+KsH4dy7QKym+yU +9SP+8B9fQ== X-PMFLAGS: 34095744 0 65537 PQVHWQ2O.CNM X-CC-Diagnostic: Body contains "click here" (20) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/ +/www.= w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:v=3D"u +rn:sc= hemas-microsoft-com:vml">=20 <head> <!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/ +><o:P= ixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![e +ndif]= -->=20
This feels like it should be easy but so much of Email::* is occupied about modifying/adding/MIMEing, etc that I can't separate out the simple "parse and extract" machinery I need. Any advice/guidance/tutorial? THANKS
In reply to Parsing an email by BernieC
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |