How can I send email to persons having in 1 column and respectd department column

I have a case,
I have a table for eg. mailid depart
abc@gmail.com cse
ha@gmail.com bsc
here I need to get abc name from mail id, and send mail to that person with body
hi abc depart cse
please help me

Hi @saritha_panguluri

use this to get the name say your email is in a string variable str then str.Split(“@”,2,Stringsplitoptions.None)(0)

Then just add whatever you need before and after string to form your mail body

Loop through table and add the Split inside the loop

cheers

I need all thes steps
1st read the table like that
please help me

HI @saritha_panguluri

Try this expression to get the name

System.Text.RegularExpressions.Regex.Match(StrVariable,"(.*?=\@)").Tostring

image

Where StrVariable = Your input CurrentRow(“mailid”).Tostring.

To add them in the body use like this
“Hi “+System.Text.RegularExpressions.Regex.Match(StrVariable,”(.*?=@)”).Tostring+"depart "+CurrentRow(“depart”).Tostring.Trim

Regards
Sudharsan

Hi!

  1. Read the table - DtOut
  2. Take one for each row in data table and pass the DtOut.
  3. Take one assign activity and create a variable called name → Type String and pass the expression like this
strName = CurrentRow("EmailColumnName").ToSting.Trim.Split("@"C)(0)

The above expression will give you the names which is before @

in this case the output will be

abc
ha
  1. Now take one send smtp mail message and pass the to field as CurrentRow(“EmailColumnName”).ToString.Trim

  2. For Department try this:

strDepartment = CurrentRow("DepartmentColumnName").ToString.Trim
  1. For Mail Body Try this
strMailBody = "Hi "+strName+". "+"Department :"+strDepartment

in each iteration the bot will pick up the name and will send the email to specified email in the table

That’s it.

Regards,
NaNi

HI @saritha_panguluri

  1. Read range to read from excel to datatable
  2. Loop using for each row in datatable
  3. Inside give assign Name = Currentrow(“Email”).ToString.Split(“@”,2,Stringsplitoptions.None)(0)
  4. Then assign body = "Hi " + Name + “Etc”
  5. Add send email and pass the body and Currentrow(“Email”).Tostring to email

Done

cheers

@saritha_panguluri

  • Use Excel Application Scope
    • Read Range and store them in the Variable called DT
  • Use For Each Row in datatable “DT”
    • Send SMTP Mail or any send mail activity and in the body field use the below
      “Hi “+System.Text.RegularExpressions.Regex.Match(StrVariable,”(.*?=@)”).Tostring+"depart "+CurrentRow(“depart”).Tostring.Trim

Regards
Sudharsan

HI @saritha_panguluri

Try with this expression

System.Text.RegularExpressions.Regex.Match(YourString,"\S+(?=@)").Tostring

image

Try with is expression

"hi"+ System.Text.RegularExpressions.Regex.Match(YourString,"\S+(?=@)").Tostring+" depart" +System.Text.RegularExpressions.Regex.Match(YourString,"\S+$").Tostring

Regards
Gokul

Hi @saritha_panguluri,

What about below workflow

Measure IsBodyHtml checkin
image

Sequence2.xaml (3.5 KB)

Thanks,
Rajkumar

thank you all

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.