AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

reading downloaded mail from pop server and take it in var

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
hsyar1
Guest





PostPosted: Sun Aug 23, 2009 7:35 pm    Post subject: reading downloaded mail from pop server and take it in var Reply with quote

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
Back to top
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Sun Aug 23, 2009 10:07 pm    Post subject: Reply with quote

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).
_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
hsyar1
Guest





PostPosted: Sun Aug 23, 2009 11:35 pm    Post subject: repaly Reply with quote

the file is massage which can open with outlook but i need some thing small and good that can convert content to variables
Back to top
Dave72



Joined: 27 Jan 2007
Posts: 30
Location: Canada

PostPosted: Sun Aug 23, 2009 11:48 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
hsyar1
Guest





PostPosted: Mon Aug 24, 2009 1:49 pm    Post subject: dont work for me Reply with quote

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!
Back to top
aaffe



Joined: 17 May 2007
Posts: 1002
Location: Germany - Deutschland

PostPosted: Mon Aug 24, 2009 2:28 pm    Post subject: Reply with quote

StringREplace,var,var,subject:
Back to top
View user's profile Send private message
hsyar1
Guest





PostPosted: Tue Aug 25, 2009 7:59 am    Post subject: thanks it s work Reply with quote

thank for all of you
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group