Can anyone share any ideas where I can extract few things from email. Meaning from the mail body.
The list that need to be extract from mail body are as below :
Subject
Received Date
Destination
Booking number
ETA
Identifier
Number of container and size
It would be really helpful if someone could help me out with this.
Mail subject & received date can be fetched using the function .subject & .DateAsDateTime, but in order to fetch the remaining details, can you please share a sample mail screen shot?
Destination dest = Regex.Match(mail.Subject,".*(?=\d{6})").Value
Container size and number
Mail.Body.Split({Environment.Newline},Stringsplitoptions.RemoveEmptyEntries) will split the body into multiple lines…you can use a loop to loop through each row as there are multipe rows of numberXsize
Inside the loop use
number = Regex.Match(currentitem,"\d+(?=X)").Value
Will send it in a while…in the mean time…all the given expressions are to be in assign…the part before equals on left and after equals on right…before equals are the variables you need to create of string type
And the split for body as mentioned would f
Go to for loop
I f you see the first two assigns I assigned two variables…either assign your subject and body to them or use mail.subject and mail.body in place of them…when i say mail.body mail is the variable containing your mail data