How to send the email/notification when the documents/batch get to Verification Stage


I would like to send an email or notification when a document/batch hit the Verification Stage


In the project-> Project Properties-> Advance workflow->create a custom script stage and give it a name such as EmailNotificationScript and place it right before the Verification stage



Inside this script, use this C# script, (if you are using a Gmail account to send the notification)

using System;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;

MailMessage message = new MailMessage();
SmtpClient smtp = new SmtpClient();
message.From = new MailAddress("");
message.To.Add(new MailAddress("sendtoemailaddress"));
message.Subject = "Test";
message.IsBodyHtml = true; //to make message body as html
message.Body = "Verification Stage";
smtp.Port = 587;
smtp.Host = ""; //for gmail host
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("", "mypassword");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;






Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



  • Avatar

    Thong Pham Hoang Nguyen


    I tried but ABBYY didn't send mail, is there any system requirement or need to be Cloud version,...

    Thank you.

  • Avatar

    Ban Tran

    Hi Thong,

    The script should work if you are using Gmail as the sender because the configuration setting is for Gmail.

    Since it is C#, my guess is you need to have the .Net framework installed. I just test the script again to make and it worked when I provide my Gmail address.

    One possible setting you may check when you are using the Gmail address is to go into your Gmail settings and under the Security option, make sure the "Less secure app access" is turned ON.

  • Avatar

    Thong Pham Hoang Nguyen

    Hi Ban Tran,

    Thanks for your detailed explanation.

    I tried running the workflow on FlexiCapture but it doesn't seem to work. Does this Workflow require uploading to the ABBYY server (Distributed) or Cloud version? Does this script work with other mail servers or only accept Gmail? I think it accepts all mail servers because this is just a script haha


  • Avatar

    Ban Tran

    Hi Thong,

    The script is part of the Workflow so as long as you import the document thru the Workflow process, then it will work. So it doesn't require to be uploaded to the Server or Cloud. But of course, if you want to process your document automatically then uploading the project to the server (Distributed/Cloud) is the way to go.

    For example, regardless you are using the local project or the project that was uploaded to the Server (Distributed), if you manually drag & drop the image into the project, then it will not work as the way you import the image is not part of the workflow.

    If you set up the images to import from Hotfolder, Email (pop3/imap/mapi/msgraph), FTP, sFTP, etc.. then the FlexiCapture project will process these images as part of the workflow.

    Regarding the script, as you already said, it is just a script so it should work with others as well, just this example I'm using Gmail so I provide the configuration for Gmail. For example, if you process with Yahoo mail then the configuration will be different (and you will need to check from the Yahoo site to see what are its configuration to send out the email. For example, the Port and the Host will be different than Gmail).


Please sign in to leave a comment.