Reputation: 43
I am trying to go through all mails in a folder and create a new mail, to an address specified in the first mail.
I need to search through the body of the email for the following: <[email protected]> and copy the email address between the two angle brackets to use it as the recipient for the new email.
Upvotes: 1
Views: 1332
Reputation: 759
you have to find out where the < and > sign ist and choose the text inbetween:
NOT TESTED
dim start_str as integer
dim end_str as integer
dim mymail as string
start_str = instr(mailitem.body,"<") + 1
end_str = instr(mailitem.body,">") - start_str
mymail = mid(mailitem.body, start_str, end_str)
I am not quite sure you might hsve to add +1 or -1 in the start- or end-string, but otherwise it should work. You only have a Problem, if the characters < or > are exist in the mail another time befor the mail-address.
I hope this helps, Max
Upvotes: 1