Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    Pgh
    Posts
    8

    Post Unanswered: Emailing Information from Access

    Is there away that I can email information from an Access Database.

    Example:
    At a form I would enter "Subject" and "Subject_Info". Then have a submit button or something that would email that off to a person or distrobution list. Or maybe send it to a Outlook template and then send that off to a person or distrobution list.

    "Subject" and "Subject_Info" are in the same table.

    Any information here would help. Please Advise

    Also if there is anybody that has a idea about enter information from a email directly into the DB that would be great.

    Thanks!

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    yes 2
    1.
    docmd.SendObject(<ObjectType>, <ObjectName>, <OutputFormat>, <To>, <Cc>, <Bcc>, <Subject>, <MessageText>, <EditMessage>, <TemplateFile>)

    2.
    Dim email As Outlook.MailItem
    Set email = CreateObject("Outlook.Application").CreateItem(olM ailItem)
    email.To = <To>
    email.Subject =<Subject>
    email.Body = <Message>
    ...
    email.Send

    take you pick
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    as for the second question
    Option Compare Database
    Option Explicit
    Dim i As Integer
    Dim inboxfolder As MAPIFolder

    Sub getMail()
    Dim inboxcontense As Outlook.Items, email As MailItem
    Dim rs As DAO.Recordset
    Dim temp As String, temp1 As String

    on error goto makefile
    retry:
    Open "H:/mdbfiles/helpdesk.dat" For Input As #1
    Input #1, temp, temp1
    Close #1
    on error goto 0


    Set inboxfolder = CreateObject("Outlook.Application").GetNamespace(" MAPI").GetFolderFromID(temp, temp1)
    Set inboxcontense = inboxfolder.Items
    Set rs = CurrentDb.OpenRecordset("jobs", , dbAppendOnly)
    For Each email In inboxcontense
    If email.UnRead Then
    With rs
    .AddNew
    !User = email.SenderName
    !DateReported = email.SentOn
    !DescriptionBrief = email.Subject
    !DescriptionFull = email.Body
    !Status = 1
    .update
    End With
    End If
    email.UnRead = False
    Next
    rs.Close

    exit sub
    makefile:
    if err.number = 53 then
    Set inboxfolder = CreateObject("Outlook.Application").GetNamespace(" MAPI").PickFolder
    Open "H:/mdbfiles/helpdesk.dat" For Output As #1
    Write #1, inboxfolder.EntryID, inboxfolder.StoreID
    Close #1
    goto retry:
    endif
    End Sub
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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