Hi, I just wanted to check if there would be no issue with me enabling the Smtp Email code in the file watcher for the duration of sending the email and then disabling it.
The clients use Outlook for emailing So, Po's etc daily but I need to be able to email any errors out of File watcher and Smtp seems the only option.
What I want to do is :
email.SystemSettings.UseOutlookForEmail = False ' Cannot use outlook from within a Windows Service - make sure your other system settings like SMTP server are configured.
email.CreateNew()
email.EmailTo = "[email protected]"
email.EmailSubject = "test email"
email.EmailBody = String.Format("Document '{0}' failed to import - error message is '{1}'", pendingFileNameAndPath, ex.Message)
email.Save()
'' THEN add
email.SystemSettings.UseOutlookForEmail = TRUe.
Will this be ok? Thanks