Adding a email recipient via VBScript

 

 

I have the following line in my VB Script to add a recipient to an e-mail:

  Action.RecipientsList.Add "UserName", "User@Domain.com"

But VBScript doesn't like that. (I had parans but that didn't help either).

What is the right syntext for this?

Thank you,

Ed Dressel

Hi Ed,

Just tested it here and didn’t have any problems, here is the exact script that I used in the BeforeAction script event.

Action.RecipientsList.Clear
Action.RecipientsList.Add “John Doe”, "j.doe@example.com"

What is the error that you’re receving?

Regards,
Paul

 

[script removed]
 

Looking a little closer, it might be the boolean variable. I have the following code:

  if HasDebugBuild then
    Action.RecipientsList.Add  "Name", "Name@Domain.com"
endif

 

and it fails on line 2--the 'if...then" condition. The default value for HasDebugBuild is "False". It does not otherwise get assigned unless a there is a debug build.

What should the default value for it be?

Thanks

Ed Dressel

Hi Ed,

Setting the value to “True” or “False” is correct; Looking at your script, the IF statement is incorrect, the endif needs a space (END IF).

Regards,
Paul.

Testing email notifications… let me know if you get an email notification about this post!

 

[script removed]
 

Thank you. Yes I did.