Disabling sending Email in production

There is an activity running through an agent which closes work objects on a nightly basis and sends an email. The email functionality is only for testing purpose.

What do I have to do to stop sending of the email in Production?
There is a data table property that is being set to an email address which can be updated in each specific environment. The @baseclass.SendEmailNotification activity picks up this value for its To Parameter and sends email to this email id which is set in the data table.
I tried setting this data table property to NULL.
Now, @baseclass.SendEmailNotification activity picks up the NULL value for its To parameter.
By doing this the activity runs fine(closes the work objects) without an exception and an email is not being sent.
Is this the correct approach or is there a better approach to this?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.


Keep up to date on this post and subscribe to comments

November 4, 2010 - 2:41pm

My suggestion would be to have a declare page with environment related properties where you can check to run/ execute any process like sending mails, debug or any environment related process!

Thanks - Suhael Rahman

November 8, 2010 - 6:54am

you can check pxProcess.pzProductionLevel property value to determine which environment you belongs to and conditionalize your code to check this property and disable the email sending functionality.


November 12, 2010 - 3:54am

why dont u play with the send-corr agent in the Assign-corr class ... ? all the solutions suggested are cool .. but at the end of the day its stopping the mail from not being sent .. isnt it ?