I'm trying to send using outlook but I get an error on the directcast line
if I don't have outlook open. Works fine if it is open. What do I need to
do to be able to send without having outlook open? Thanks
Dim objOutlook As New Outlook.Application
Dim objMail As Outlook._MailItem =
DirectCast(objOutlook.CreateItem(Outlook.OlItemTyp e.olMailItem),
Outlook._MailItem)
Dim mSubject As String
Dim mBody As String
mSubject = client & " - " & fDescription.Text
mBody = ControlChars.CrLf & "file:" & fFilename.Text & ControlChars.CrLf &
ControlChars.CrLf &
With objMail
..BodyFormat = Outlook.OlBodyFormat.olFormatRichText
..To = us**@domain.com
..Subject = mSubject
..Body = mBody
..Send()
End With
objMail = Nothing
objOutlook = Nothing