Jump to content

New email -- Save to Text


bartekd
 Share

Recommended Posts

I tried it and it just says running, and doesn't go anywhere. normally for my exchange server, I just put port 25, and it works with other apps. If I put that it sticks on running and doesn't go anywhere

I tried port 443, 110, 465 etc, and I get one of the below.

rmtree failed: Directory not empty

Transaction Failed! (get_message())rmtree failed: Directory not empty

Link to comment
Share on other sites

I tried that, and it just outputs a bunch of random characters. Here is part of it. Any Idea why it is doing that?

ontent-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: base64
PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBUcmFuc2l0aW9uYWwv
L0VOIj4NCjxIVE1MIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy9UUi9SRUMtaHRtbDQwIiB4bWxu
czp2ID0gDQoidXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp2bWwiIHhtbG5zOm8gPSANCiJ1cm46
c2NoZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTpvZmZpY2UiIHhtbG5zOncgPSANCiJ1cm46c2No
ZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTp3b3JkIiB4bWxuczptID0gDQoiaHR0cDovL3NjaGVt
YXMubWljcm9zb2Z0LmNvbS9vZmZpY2UvMjAwNC8xMi9vbW1sIj48SEVBRD4NCjxNRVRBIEhUVFAt
RVFVSVY9IkNvbnRlbnQtVHlwZSIgQ09OVEVOVD0idGV4dC9odG1sOyBjaGFyc2V0PXV0Zi04Ij4N
Link to comment
Share on other sites

The email is base64 encoded..

this is what it would be after decodeing the snippet you posted. I think there is an autoit udf for base64 decoding and encoding. Id look around

<p><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =

"urn:schemas-microsoft-com:vml" xmlns:o =

"urn:schemas-microsoft-com:office:office" xmlns:w =

"urn:schemas-microsoft-com:office:word" xmlns:m =

"

Link to comment
Share on other sites

Thanks for pointing me in the right direction. I was able to decode it with another script in Auto it. One more question. Don't mean to be a bother, but I am so close to completing my script.

When I get the email using your method, it splits it into 2 sections. How do I extract only the base64 data so that I can convert it. FYI, it looks something like this... (I changed some things and removed the base64 data.

id ; Wed, 23 Jan 2013 09:14:13 -0500
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01CDF973.EBA510C0"
Content-class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft Exchange V6.5
Subject: FW: Closed.....
Date: Wed, 23 Jan 2013 09:14:13 -0500
Message-ID: <1234123412341234>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Closed.....
thread-index: asdfasdfasdfasdfasdfasdf
X-Priority: 1
Priority: Urgent
Importance: high
From: "me"
To: "to name"

This is a multi-part message in MIME format.

------_=_NextPart_001_01CDF973.EBA510C0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: base64

****** Base64 data *****

------_=_NextPart_001_01CDF973.EBA510C0
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: base64

****** Base64 data *****

------_=_NextPart_001_01CDF973.EBA510C0--
Link to comment
Share on other sites

Look up the function stringregex and you can use regular expression to jump down to the sections you need, and store it to a variable, and do whatever you want with it from there.

Something like:

Local $file = "C:\output.txt"
$file = FileRead($file)
global $base64_1 = StringRegExp($file, '(-----_=_.+\s.+\s.+\s.+)',1)
; Or
global $base64_2 = StringRegExp($file, '(-----_=_.+)\s(.+)\s(.+)\s(.+)',1)
ConsoleWrite("Whole Base64 section: " & @CRLF & $base64_1[0] & @CRLF)
ConsoleWrite("or just Line 1 " & $base64_2[0] & @CRLF)
ConsoleWrite("or just Line 2 " & $base64_2[1] & @CRLF)
ConsoleWrite("or just Line 3 " & $base64_2[2] & @CRLF)
ConsoleWrite("or just Line 4 " & $base64_2[3] & @CRLF)

Don't be afraid to give it a run, and show us where you get stuck. People will help, but won't do it for you.

Edited by Iceburg
Link to comment
Share on other sites

thanks somdcomputerguy, this may be helpful as well. I almost have the EMIACtrlLite running the way I want it. I just now have to figure out how to delete the email too. Will get to that shortly.

PopTray mail notifier I will also look at soon. Thanks for suggesting it. :)

Link to comment
Share on other sites

$pop_mail.get_message(1,1)) the second parameter is the delete switch. If it is 0 = dont delete if it is 1 then it will delete the email. I would be careful with this since if you delete it will be gone no recycle bin. I would only do this after you know everything works the way you want and maybe have the original email put in a backup folder until you get the unexpected bugs that pop up fleshed out.
Link to comment
Share on other sites

I tried that, and it doesn't want to work. This is what I have. After I run it, it leaves the email on the email server...

$pop_mail = ObjCreate("EmiaLITE.SendRetrieve")
  $pop_mail.set_POP3('EmailServer','110',$user,$userp)
  $pop_mail.connect_messageX_POP3()
  $message = $pop_mail.get_message(1,1)
  FileWriteLine($textfile,$message)
Link to comment
Share on other sites

by message index, do you mean email number? if so, I tried multiple numbers there, and putting lots of emails in the inbox. They won't delete.

I will try to put $objMailer.close_messageX_POP3() at the end of my script to see if it will delete the email on Monday. Thats when I am in the office next.

I appreciate your support. Thanks for your help. :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...