Hi,
I am facing this problem from time to time to, but I am using POP3 and SMTP for synchronizing the mails.
I now "developed" a powershell script, that checks the event log at the server, where email router is running, for any logged errors for source MSCRMEmail for the current day.
If an error is returned, an e-Mail containing the error is sent to my admin users.
I have created a recurring task in the application Task Scheduler, which starts at 7 in the morning and runs every hour for 12 hours, which executes this script.
So at least 1 hour later I am notified, in case e-mails are stuck in the email router.
Currently my script is configured to return all errors for source MSCRMEmail. It could also be reduced to certain event ids.
Maybe this is also of help for you, in case you should be able to send mails via smtp from the Server.
br Thomas
Script:
--------
# Filter Event log for MSCRMEmail Router for errors for the current day - reduce to 10 latest entries
$date = get-date -format d
$eventlog = Get-EventLog -logname Application -Source MSCRMEmail -after $date -EntryType Error -Newest 10 | select timegenerated, entrytype, source, message, eventid
# If an error is returned, an e-mail is sent
if ($eventlog -ne $null) {
$text = $eventlog | out-string
$smtp = new-object Net.Mail.SmtpClient("<your smtp server>")
if( $Env:SmtpUseCredentials -eq "true" ) {
$credentials = new-object Net.NetworkCredential("username","password")
$smtp.Credentials = $credentials
}
$objMailMessage = New-Object System.Net.Mail.MailMessage
$objMailMessage.From = "<your sender mail address>"
$objMailMessage.To.Add("<recipient e-Mail address 1")
$objMailMessage.To.Add("<recipient e-Mail address 2")
$objMailMessage.Subject = "CRM - Email Router Error"
$objMailMessage.Body = "$text"
$smtp.send($objMailMessage)}