I searched the archives and found this post about sending email.
It would seem to be what I need, except that the help file on the mailmessage class says supported platforms start with W2K. The users of the app have W98, so it looks like this won't work. Any other ideas?. I want to automate sending a text file, or at least it's contents, via Outlook on Microsoft Exchange. Thanks.
Last edited by salvelinus; Mar 19th, 2004 at 12:51 PM.
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
Not sure on that - I'm guessing yes but not 100% sure. In theory it only uses the .Net framwork and SMTP server so it should do...
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
I gave up on all that, thanks anyway. Our mail is internal, doesn't use SMTP (per the boss). Our web site is hosted by another company. I did get it to work, but it sent the email directly; there was no record in Outlook's Sent folder of the message.
I eventually just programmed Outlook with the code below.
Had to ctype msg when using .send() because I got an "ambiguous" error across the interfaces Outlook._mailitem and Outlook.ItemEvents_event interfaces, don't know why.
Anyway, thanks for the help.
Code:
Public Sub LetsSendMail()
Dim OlApp As New Outlook.Application()
Dim OlNameSpace As Outlook.NameSpace
Dim msg As Outlook.MailItem
Try
msg = OlApp.CreateItem(Outlook.OlItemType.olMailItem)
msg.Recipients.Add("jimbo")
msg.Subject = Current.Proj & " Edited Changes"
msg.Attachments.Add(strPathToFile)
msg.Body = "Changes attached."
CType(msg, Outlook._MailItem).Send()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub