Results 1 to 4 of 4
  1. #1
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544

    sending email through Access function doesn't work when client is on Exchange


    Hello all,

    I was wondering if anyone else has run into this problem. I have a function that sends an email from an Access form, which works fine on my machine (not on exchange server), but does not work for my clients (who are on Exchange server). Is there some reason this might be occurring?

    I thank you in advance and wish you all a wonderful day!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    What is your code? Some methods use the default mail client, some do not.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Gina Maylone is offline Always learning
    Windows 7 64bit Access 2013
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    DoCmd.SetWarnings False

    Dim MyTrackingTable As Recordset
    Set MyTrackingTable = CurrentDb.OpenRecordset("SentEmails")
    DoCmd.OpenQuery "DeleteTempConfEmails"
    DoCmd.OpenQuery "AddtoTempConfEmailTable"
    DoCmd.OpenQuery "AddtoTempConfEmailTable2"
    Dim stDocName As String

    DoCmd.RunMacro "outputletter"


    Dim db As DAO.Database
    Dim MailList As DAO.Recordset
    Dim MyOutlook As Outlook.Application
    Dim MyMail As Outlook.MailItem
    Dim Subjectline As String
    Dim BodyFile As String
    Dim MyBody As String

    Dim MyBodyText As String

    Subjectline = "Thank you for choosing John's Moving"


    Set db = CurrentDb()
    Set MailList = db.OpenRecordset("TempConfEmailTable")

    Do Until MailList.EOF
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)
    With MailOutLook

    BodyFormat = olFormatHTML
    .To = MailList("emailaddress")
    .SentOnBehalfOfName = "chris@johnsmoving.com"
    .Subject = "Thank you for choosing johns's Moving"
    If Me.TravelMove = True Then
    .HTMLBody = DLookup("travelmessage", "emailmessages")
    Else
    .HTMLBody = DLookup("morningmessage", "emailmessages")
    End If

    .Attachments.Add ("c:\johns moving\documents\Boxes and Packing Supplies.pdf")
    .Attachments.Add ("c:\johns moving\documents\Home Packing Tips.pdf")
    .Attachments.Add ("c:\johns moving\documents\insurance and agreement.pdf")
    .Attachments.Add ("c:\johns moving\documents\confirmationletter.pdf")
    '.Attachments.Add ("c:\johns moving\documents\confirmpage2.pdf")

    If Me.WinterMOve = True Then
    .Attachments.Add ("c:\johns moving\documents\Winter Moves.pdf")
    End If
    If Me.StorageMove = True Then
    .Attachments.Add ("c:\johns moving\documents\self storage form.pdf")
    End If


    On Error Resume Next
    .send
    'If Err.Number Then MsgBox "Failure"


    MyTrackingTable.AddNew
    MyTrackingTable("emailaddress") = MailList("emailaddress")
    MyTrackingTable("emailsubject") = "Move Confirmation"
    MyTrackingTable("DateSent") = Now()
    MyTrackingTable("Created By") = Me.ConfirmationMadeby
    MyTrackingTable.Update
    End With

    MailList.MoveNext

    Loop
    MsgBox "Email Sent! Please look in your Sent Items folder to verify."

    Set MyMail = Nothing
    Set HTMLBody = Nothing
    'Set Subject = Nothing
    Set Attachment = Nothing


    'MyOutlook.Quit
    Set MyOutlook = Nothing

    MailList.Close
    Set MailList = Nothing
    db.Close
    Set db = Nothing

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    You're using early binding, which would require them to have the same version of Outlook you have. Do they? What error do they get by the way?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 01-17-2014, 03:43 PM
  2. Replies: 3
    Last Post: 01-07-2014, 09:57 AM
  3. Replies: 1
    Last Post: 09-18-2013, 08:12 AM
  4. sending email through Access
    By crowegreg in forum Import/Export Data
    Replies: 4
    Last Post: 04-15-2012, 03:49 PM
  5. Replies: 2
    Last Post: 01-03-2011, 05:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums