Hi all, I have a registration details sent to me by an administrator, the details contain the email address of the registrant whom I will send an outlook email, the problem is how to get the email address from the outlook mail and send a message to that user email address.Please assist
So basically you are getting that sender email address in a body?
You can get the Body of receiving email, and filter that message only to extract email, then use that Email to send a message.
Could you share example of how this message that you receive looks like?
Yes, this is the body;
Thank you for registering. Your information is as follow:
First Name: Collins
Last Name: Anthony
Email (UserID): firstname.lastname@example.org
You can use this Regex expression in Matches activity:
In Matches activity you have
-Input (this will be the body of email)
-Pattern (this will be pattern from the link)
-Result (create the result named RegexResults with ctrl+K)
After that use Assign activity to assign some variable, lets say eMail with
eMail = RegexResult(0).Value
I have this match (?<=Email (UserID):).*.How do you want me to assign this
Cos I didn’t get this part: eMail = RegexResult(0).Value
RPAbotDev.xaml (4.8 KB)
Here you go, hope it clarify what I want to say
Please resend, missing activity
Are you there?
I am here now.
RPAbotDev.xaml (4.9 KB)
Try it now. Its the Matches activity
@srdjan.suc, thanks for the info, the message box is displaying the same email each time I run and I have different emails. How do I change it so it can run other emails
you need to change the value of email variable, because the value that I typed into is static
Thanks @srdjan.suc, please I want to send the mail and included it as this
but got the error message that outlook does not recognize one or more names.How do I resolve it please
you don’t need .ToString since the .Value already returns you a String.
See maybe to use .Trim if there is some leading or trailing spaces, maybe that is causing the issue.
What do you get in the message box above?
how do I remove the second part
You can split the string on the space
RegexResult(0).Value.Split(" "C) then store that in StringArray, and use StringArray(0) in “TO”
I did the assign but got the error “cannot assign from type system.object to type system.string”