How do I insert data in SQL Server even if mail sending process get error

Hi everyone,

The workflow that i created create a temp table. Then sending mail for each value of this table. And then insert another table that data sended mail.

But sometimes mail sending process may getring error. And in such cases the process stops. The temp table remains created, but the insert operation is after the sending of the mail, so that operation cannot be performed.

I would like to proceed to the next insert operation, even if sending mail stops. How can I do that?

Hi @mazlumkacar
first insert thr data by using connect and insert command and based on datatable

Check whether it has String.IsNullorEmpty(InDatatable)
use send mail message of the table if fails means use throw statement

Thanks
Ashwin S

Thanks for answer @AshwinS2

But i mean, i have created this workflow and it is work. The problem is; when Send SMTP Mail Message Activity is getting error. Then the workflow is stop.

But i want to process continue and insert data in such case. Do you know how may i do that?

@Palaniyappan

1 Like

Hi
Kindly keep this sequence inside the TRY block of TRY CATCH activity and again the last two EXECUTE QUERY activities inside the CATCH BLOCK
so that if any exception occurs in the try block with send outlook mail activity or if in execute query it will go to CATCH block where it will try to execute the query either

Cheers @mazlumkacar

1 Like

@Palaniyappan

You mean: i shoud keep both of the query inside Catch block and also Try block?

Because i also want to send mail if there is not an exception.:sweat_smile:

1 Like

yes buddy @mazlumkacar

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