stealthmsgr Posted July 20, 2012 Share Posted July 20, 2012 Per earlier conversation with Water. I am looking for ideas. The scenario is this: Windows 2003 R2, Exchange 2003, Outlook 2003 (plain text). Email from one input is incompatible with messaging std in that in the entire message body is used <CR> <CRLF>. This is no problem until at the end of the Subject line and the start of the body. OL can't determine the begining of the message body and inputs lines of the MIME header into the message body. Waters Outlook UDF is the way to go. Can I parse (strip off, or filter) the MIME header? or pull out the message body? Either way I need to re-send the message back into OL. Thanks for any help. Link to comment Share on other sites More sharing options...
water Posted July 20, 2012 Share Posted July 20, 2012 The only function coping with MIME headers is _OL_MailheaderGet. The message body of a mail is just a property you access using _OL_ItemGet. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
stealthmsgr Posted July 20, 2012 Author Share Posted July 20, 2012 Being new to Autoit, but this is fixed (at the end of each line) can I look for the <CR> <CRLF> and insert a <LF> into the position after the first <CR>? This could be done in the entire messge without harming anything I think? Link to comment Share on other sites More sharing options...
water Posted July 20, 2012 Share Posted July 20, 2012 Should be possible. You retrieve the body into a variable, change whatever you need to change and then create a new mail using the changed body. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
stealthmsgr Posted July 20, 2012 Author Share Posted July 20, 2012 I see. The problem and where I'm hesitant with that is in non-repudiation. Link to comment Share on other sites More sharing options...
water Posted July 20, 2012 Share Posted July 20, 2012 But wouldn't it be easier to talk to the sender of these mails and convince him to make his mails conforming to standards? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
stealthmsgr Posted July 20, 2012 Author Share Posted July 20, 2012 Under normal circumstances. This is a specific system that can't be changed. Link to comment Share on other sites More sharing options...
water Posted July 20, 2012 Share Posted July 20, 2012 In this case i would create a copy of the mail, change the body to my needs and then process this modified mail. The original mail should be moved to an archive for any kind of audit. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
stealthmsgr Posted July 20, 2012 Author Share Posted July 20, 2012 Good idea. I'll give it a go. Thanks for the help. I'll update you if you're interested. Link to comment Share on other sites More sharing options...
water Posted July 20, 2012 Share Posted July 20, 2012 Sure. Use _OL_ItemCopy, _OL_ItemGet, _OL_ItemModify and _OL_ItemMove for this job. If you have any questions or run into problems I will be glad to assist. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
stealthmsgr Posted July 20, 2012 Author Share Posted July 20, 2012 Will do. I'll post how this works out. Cheers. Link to comment Share on other sites More sharing options...
stealthmsgr Posted July 31, 2012 Author Share Posted July 31, 2012 Water, I am pulling out the message body and working with it in text form to remove the <CR>. I'm having some problems with finding the single occurance of <CR> from the <CRLF>.The line formation is like this:Blah Blah Blah <CR><CRLF>Blah Blah Blah <CR><CRLF>Etc.So far I'm using StringRegExpReplace($chars, "®", @CRLF) to find it, but I get an extra <LF> in the text body.I guess I could also replace the <CR><CRLF> instance with <CRLF><CRLF>.I have worked some with the regular expressions tables and looked at the PCRE reference info and I'm just not connecting the dots.DUH!Can you give me a few pointers to get me moving again? Link to comment Share on other sites More sharing options...
water Posted July 31, 2012 Share Posted July 31, 2012 I'm not very familiar with regular expressions as well. So I would replace <CR><CRLF> with <CRLF><CRLF> using StringReplace. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
stealthmsgr Posted August 10, 2012 Author Share Posted August 10, 2012 Water, As promised this is the code I produced to strip the <CR><CRLF> from the text copy. It looks for an instance of the text to appear, then copies a duplicate to work with. Then does a RegEx replacement into a 3rd text file for resending into Exchange. I leave the first copy untouched for non-repudiation (of sorts). Guess I could kill off the 2nd copy in the process. Might be a little sloppy but I've have the correct combination to strip the command characters off. Now I just need to resend it back into Exchange. Any ideas? local $chars, $file, $filename Local $file = FileOpen("C:Data Filetestfile.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in characters While 1 Local $chars = FileRead($file, -1) If @error = -1 Then ExitLoop MsgBox(0, "MSG:", $chars) FileWrite("C:Data Filetest2.txt", $chars) Local $sOutput = FileRead($chars, -1) Local $sOutput = StringRegExpReplace($chars, "rsH", @CRLF) FileWrite("C:Data Filetest3.txt", $sOutput) Exit WEnd FileClose($file) Link to comment Share on other sites More sharing options...
water Posted August 10, 2012 Share Posted August 10, 2012 You can use functions _OL_ItemCreate and _OL_ItemSend to create and send a mail. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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