Ahk_fan wrote: ↑22 Sep 2023, 06:43
alternative: this function connects to Outlook and reads actually selected Mail.
call
Code: Select all
EmailOutlookInformation(Sub, Body, SenderEmail, SenderNames)
msgbox, %Sub%, %Body%, %SendeEmail%, %SenderNames%
and this Function:
Code: Select all
EmailOutlookInformation(Byref Subject, Byref Body, Byref SenderEmail, byref SenderName) {
Ol := ComObjActive("Outlook.Application")
Selection := Ol.ActiveExplorer().Selection
Loop, % Selection.Count
{
ThisItem := Selection.Item(A_Index)
DateReceivedTime := RegExReplace(ThisItem.ReceivedTime, "\W")
DateMailDD := SubStr(DateReceivedTime, 1, 2)
DateMailMM := SubStr(DateReceivedTime, 3, 2)
DateMailYYYY := SubStr(DateReceivedTime, 5, 4)
DateMail := DateMailYYYY . DateMailMM . DateMailDD
TimeMail := SubStr(DateReceivedTime , 9, 6)
DateReceivedTime := DateMail . "" . TimeMail
Subject := ThisItem.Subject
SenderName := ThisItem.SenderName
SenderEmail := ThisItem.SenderEmailAddress
SenderEmailType := ThisItem.SenderEmailType
Body := ThisItem.Body
RecipientsCount := ThisItem.Recipients.Count
loop, %RecipientsCount%
{
SendTo2 := SendTo2 "/" ThisItem.Recipients(A_Index).Name
}
}
}
This is so amazing. How u can write it so perfectly.
How you can ignore <link> from that text. I mean plain text.
This is my sample data
<https://> <https://>
<https://>
text <https://> : text1 text2 <https://>
text4
How to extract it to plain text with out link like below.
text: text1 text2
text4
idk how to say thank you better.
Update : never mind sir . I found it . it name SendRaw, %Body%.
Omg thank you sir. If you read this please let me know where to learn to write that function .
Update : SendRaw not working it still have many text like : <link> text <link>.
Now i have to find a way to remove all this <link>
![Sad :(](./images/smilies/icon_e_sad.gif)