Results 1 to 5 of 5

Thread: E-mail from app [Resolved]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    E-mail from app [Resolved]

    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.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Try this one
    Attached Files Attached Files

    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

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    Thanks, that looks like a good idea. But will it support Windows 98? That's the problem. The only ones with W2K here are me and my boss.

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width