radeonorama Posted March 3, 2011 Share Posted March 3, 2011 Hi everyone, I'm in the process of writing an app which downloads emails from a pop3 account and saves them individually as a txt file containing the subject and the body of the email. The email contains various text including "£" and "=" signs which are being converted into =A3,=3D? As i want to output these emails into a txt in their original format, im a little lost how i would convert it back £'s and ='s. Could anyone give me a nudge in the right direction, I have been trying to look around with the search criteria of CharSets and and text encoding but im not really sure what im looking for. Any help would be much appreciated. Thanks, Rad Link to comment Share on other sites More sharing options...
trancexx Posted March 3, 2011 Share Posted March 3, 2011 Search quoted-printable ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
radeonorama Posted March 3, 2011 Author Share Posted March 3, 2011 Search quoted-printableCould you give me a little more than that please? :-) Link to comment Share on other sites More sharing options...
trancexx Posted March 3, 2011 Share Posted March 3, 2011 (edited) If your messages are multi-part in MIME format then you probably want: Content-Type: text/plain; ...part. Depending on charset and transfer encoding you can convert that to "original format" as you say, by using e.g. CDO. But see, I started this post with "If...". You should give a little more for others not to start their posts with "if". Edited March 3, 2011 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
radeonorama Posted March 4, 2011 Author Share Posted March 4, 2011 (edited) If your messages are multi-part in MIME format then you probably want: Content-Type: text/plain; ...part. Depending on charset and transfer encoding you can convert that to "original format" as you say, by using e.g. CDO. But see, I started this post with "If...". You should give a little more for others not to start their posts with "if". I would love to give a bit more info but that's the problem, im unsure of what information to give as im a bit lost :-(. I have kinda been thrown in at the deep end in being asked to work this out and im not really sure where to start?! :-( This is the form of the email when received if it helps make sense of things? (with some of the top header details removed containing personal details. expandcollapse popupMIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Language: en-gb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D -=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3DClient Details=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Title : Forename : Surname : Address : District :=20 Town : County : Postcode : Daytime Telephone Number : Evening Telephone Number : Mobile Telephone Number : Email : =3DLead Details=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Source : D.O.B : Timescale : Smoker : Life or Critical : Cover Period : Purpose : Joint : Partner Title : Partner Forename : Partner Surname : Partner D.O.B : Partner Smoker : Amount of cover required : =A3 Maximum Monthly Payment : =A3 Edited March 4, 2011 by radeonorama Link to comment Share on other sites More sharing options...
jchd Posted March 4, 2011 Share Posted March 4, 2011 The sample you provide shows a quoted-printable (QP) part of a multipart email. If you want to save the email(s) in their _original_ form you have nothing to do, as they are fine and seem to be well-formed (albeit using quoted-printable is now questionable, but this is another discussion entirely). If you want to store the _body_ of such QP part in a more readable form, then you can do so but the email as a whole won't be consistent anymore: the part announces a QP form but the inner isn't QP anymore. If you decide it should be consistent you have to change the multipart header and its content into something else. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
martin Posted March 4, 2011 Share Posted March 4, 2011 The sample you provide shows a quoted-printable (QP) part of a multipart email. If you want to save the email(s) in their _original_ form you have nothing to do, as they are fine and seem to be well-formed (albeit using quoted-printable is now questionable, but this is another discussion entirely).If you want to store the _body_ of such QP part in a more readable form, then you can do so but the email as a whole won't be consistent anymore: the part announces a QP form but the inner isn't QP anymore. If you decide it should be consistent you have to change the multipart header and its content into something else.I would be very surprised, based on what the op has already said, if that helps him at all, but no doubt you enjoyed writing it. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
ProgAndy Posted March 4, 2011 Share Posted March 4, 2011 Here are some UDFs that help when dealing with encoded mailbody and mail headers http://autoit.de/index.php?page=Thread&postID=87721#post87721 mLipok 1 *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
radeonorama Posted March 9, 2011 Author Share Posted March 9, 2011 Here are some UDFs that help when dealing with encoded mailbody and mail headers http://autoit.de/index.php?page=Thread&postID=87721#post87721Dude! You're a legend!! Problem Solved!! :-D Thank you!! The Function "_QuotedPrintableDecode" worked Perfectly. :-)" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now