 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
hsyar1 Guest
|
Posted: Sun Aug 23, 2009 7:35 pm Post subject: reading downloaded mail from pop server and take it in var |
|
|
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
|
|
| Back to top |
|
 |
hsyar1 Guest
|
Posted: Sun Aug 23, 2009 11:35 pm Post subject: repaly |
|
|
| 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
|
Posted: Sun Aug 23, 2009 11:48 pm Post subject: |
|
|
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 |
|
 |
hsyar1 Guest
|
Posted: Mon Aug 24, 2009 1:49 pm Post subject: dont work for me |
|
|
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
|
Posted: Mon Aug 24, 2009 2:28 pm Post subject: |
|
|
| StringREplace,var,var,subject: |
|
| Back to top |
|
 |
hsyar1 Guest
|
Posted: Tue Aug 25, 2009 7:59 am Post subject: thanks it s work |
|
|
| thank for all of you |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|