Results 1 to 11 of 11

Thread: Sending e-mails from Access using Outlook [resolved]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    262

    Sending e-mails from Access using Outlook [resolved]

    Hi this is a problem which I'm realy stuck on. For a bit of background we use Exchange 2003 as are mailserver and have outlook 2000 clients.
    I have an e-mailer program which takes an e-mail it recives and forward it out again. The problem is we have a client complaing saying he only wants the e-mail we send him to be in plain text. If I send the program straight from Outlook it's fine, but for some reson when I use the below code to send an e-mail it's sent as both plain text and HTML, anyone now how to change this.

    VB Code:
    1. Private Function sendemail(todest As String, subject As String, body As String) As Boolean
    2. On Error GoTo sendwarning:
    3. Dim fnam As String
    4. Dim loopcounter As Integer
    5. loopcounter = 0
    6.  
    7. Set objMailitem = objApp.CreateItem(olMailItem)
    8. If addatt Then
    9. Set myatts = myitem.Attachments
    10.         If myatts.Count > 0 Then
    11.             Set myatts = myitem.Attachments
    12.             Set objattachments = objMailitem.Attachments
    13.            
    14.             Do While loopcounter < myatts.Count
    15.                 loopcounter = loopcounter + 1
    16.                 Set myatt = myatts(loopcounter)
    17.                 fnam = myatt.FileName
    18.                 If Mid(fnam, 1, 4) = "Page" Then
    19.                     fnam = Mid(fnam, 1, 11)
    20.                 End If
    21.                 myatt.SaveAsFile fnam
    22.                
    23.                 objattachments.Add (fnam)
    24.    
    25.             Loop
    26.        
    27.         Else
    28.             Set myatt = Nothing
    29.         End If
    30. End If
    31. objMailitem.To = todest
    32. objMailitem.subject = subject
    33. objMailitem.body = body
    34. objMailitem.Send
    35. sendemail = True
    36. Exit Function
    37.  
    38. sendwarning:
    39. sendemail = False
    40.  
    41. End Function
    Last edited by Oliver1; Feb 1st, 2005 at 10:50 AM.

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