With this code i send a email with outlook.
it works great , but when there is no outlook on the pc installed the programma crash.Code:Dim application = New Microsoft.Office.Interop.Outlook.Application Dim outlookEmail = CType(application.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem), MailItem) outlookEmail.To = "*********@gmail.com" outlookEmail.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatPlain outlookEmail.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceNormal outlookEmail.Body = ("Test") outlookEmail.Subject = ("Ok") outlookEmail.Display(False) outlookEmail.Send()
Try and catch is not working ?
The error is
Who can help me ?Code:'Catch' cannot catch type 'Microsoft.Office.Interop.Outlook.Exception' because it is not 'System.Exception' or a class that inherits from 'System.Exception'.




Reply With Quote