Sending Email with REFramework Config

Hello,

I want to send Email via Gmail thanks to Config file in REFramework but I’m always getting an error.

Config settings:

image

Argument Settings:

But in this case it doesn’t work. I tried different things but it always failed.

When I write in to and cc parts, it works.

New String() {“example1@gmail.com”, “example2@gmail.com”}

But I want to write in this areas with in_reportTo and in_reportCC not manual. Can you please help me to solve this problem?

Edit: Guys I need 3 types of info from you. there are lots of message and it’s getting hard to follow.

1st: What should I choose as the type of in_reportTo argument in the workflow?
2nd: What should I write as “Value” for the key in_reportTo ?
3rd: what should I write “To” area in Send E-mail activity?

Thanks in advance.

@Sekoleyte,

Try using this way I’m using:

in_reportTo.Trim.Split({";"}, StringSplitOptions.RemoveEmptyEntries).Select(Function(s) s.Trim()).ToArray()

Hi @ashokkarale

It gives error when I write it here.

@Sekoleyte

instead of passing it as array, pass it as string and try
make sure in config use ; as separator of emailid and pass that string in To section then try.

@ashokkarale in_reportTo argument type is System.String and you can see I’ve splitted Config value “Config(“reportTo”).ToString().Split(”;“c)” with that.

Config("reportTo").ToString().Split(";"c)

Regards,
Arivu

It was already like this. I shared it in my 1st message.

@Sekoleyte,

No need to split it. Just pass the full string.

Also what’s the error message?

Step1:Convert Emails from Config into an Array

1-in_reportTo = Config(“reportTo”).ToString.Split(";“c).Select(Function(email) email.Trim()).ToArray()
2-in_reportCC = Config(“reportCC”).ToString.Split(”;"c).Select(Function(email) email.Trim()).ToArray()

Note: in_reportTo and in_reportCC should be Array of String (String)

Step2: When passing the email array to the Send Mail Activity, convert it into a comma-separated string:

For To field: String.Join(“,”, in_reportTo)
For CC Field:String.Join(“,”, in_reportCC)

Try that and let me know if it works! :rocket:

Hi.

I changed type as string as you can see. and then i changed value as

But it didn’t work.

Config(“reportTo”).ToString if I write it like this, it gives me an error because my in_reportTo argument type is System.String

Hi. It still gives error after doing what you did.

hi @Sekoleyte
You can pass your email list as a string.
In your config file, store your emails as follows:
image

and directly pass the value from the config
Config(“CCEmail”).ToString()

String.Join(“,”, in_reportTo.ToArray())
try adding .toarray() at the end it should read it as a string of arrays

@Sekoleyte

Follow the below steps,

After reading the config file,
take it as string assume that Config(“ToEmail”)

in send email activity in To section Config(“ToEmail”).tostring().split(“;”,c)

Hi. Okay I also tried this one. You want me to choose the type of in_reportTo as string in this case. Then what should I write in “To” area?

image

Hi @Mohammed_Shalaby

It still gives error.

Hi @yedukondaluaregala Do you want me not to use in_reportTo argument in the workflow?

@Sekoleyte

  1. Remove the ending semi colon in any string you use in config…it should be present only between emails…if single email just give the email without semi colon
  2. what do you have in in_Outputpath and how are you passing it and does it have a valid path or no?
  3. Remove any spaces present before or after email in config

cheers

Hello @Anil_G it was just an example not to show sensitive information, it’s not like this in real mail addresses. And it works when i type them as

New String() {“example1@gmail.com”, “example2@gmail.com”}