AutoHotkey Community

It is currently May 26th, 2012, 8:37 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: August 23rd, 2009, 8:35 pm 
I used Command Line pop client to download email and now I need to retrieve each one of To , From , Subject , body , and attach of each massage to variables like:
%To% , %From% , %subject% , %body% and %body%
to use it in my program
please help


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 23rd, 2009, 11:07 pm 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
hsyar1 wrote:
I used Command Line pop client to download email ...

What did you download it to/as? What is the file type? Perhaps try using FileRead, FileReadLine, or Loop (read file contents).

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


Report this post
Top
 Profile  
Reply with quote  
 Post subject: repaly
PostPosted: August 24th, 2009, 12:35 am 
the file is massage which can open with outlook but i need some thing small and good that can convert content to variables


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 12:48 am 
Offline

Joined: January 27th, 2007, 8:24 pm
Posts: 30
Location: Canada
I played with email for a bit, heres a section of code
Code:
CheckMail:
Run, "getmail.exe" -u %UserName% -pw %password% -s %server% -delete,,Hide
  WinWaitClose, getmail.exe
Sleep, 1000  ; allow time for txt files to get written to hd before proceeding, inc/dec as required..

  Loop, *.txt
    {
        Loop, Read, %A_LoopFileName%
        {
          If A_LoopReadLine Contains Subject:
              Subject = %A_LoopReadLine%
          If A_LoopReadLine Contains Date:
              Date = %A_LoopReadLine%

etc  (lots more code follows, but specific to my useage..)


So, a fileread loop would work. Getmail puts the emails as MSGxxx.txt so the first loop reads all the emails one at a time, the inner loop reads each email contents one line at a time. I dont quite recall, but I think Getmail overwrites the MSG001.txt etc files on each run.. so you should move/etc the emails each run.

Of course, %username% password and server are read in from an ini file, but you can code them into the line.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: dont work for me
PostPosted: August 24th, 2009, 2:49 pm 
the way you used is work but the " subject: " word must be removed from variable and when I try stringreplace is not got to work!


please if any way I can remove subject: word from variable tell me!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 24th, 2009, 3:28 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
StringREplace,var,var,subject:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: thanks it s work
PostPosted: August 25th, 2009, 8:59 am 
thank for all of you


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, joetazz, Leef_me, Mickers, tidbit, tomoe_uehara and 56 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group