Emailing with Access

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • marjbell@gmail.com

    Emailing with Access

    I have a Access database of email addresses that I would like to mass
    email to customers. Can Access be used through Outlook? or can it just
    be done with Access? I know it is possible to use MailMerge for
    snailMail.
  • timmg

    #2
    Re: Emailing with Access

    On Apr 29, 1:30 pm, marjb...@gmail. com wrote:
    I have a Access database of email addresses that I would like to mass
    email to customers. Can Access be used through Outlook? or can it just
    be done with Access? I know it is possible to use MailMerge for
    snailMail.
    You may want to consider using MS Word. Create the document as you
    would any mail merge using a query of your Access data as the data
    source. Select "Merge to Email" as your output option.

    I like this approach because it allows personalization of the outgoing
    message ("Dear Tim, you've been a member of XYZ for 12 years") and
    it's easy to assign the task to any staff person (all they really need
    to know if Word).

    Note that your ISP may not like the volume of messages going out
    through Outlook/Exchange and it can take a while to cycle through
    several thousand records. Then you'll have to sort through the
    undeliverable/returned mail, but that can be quite an education about
    your customers.

    For a large volume solution you may want to look at a commercial email
    service such as Constant Contact or similar.

    Good luck,

    Tim Mills-Groninger

    Comment

    • fredg

      #3
      Re: Emailing with Access

      On Tue, 29 Apr 2008 11:30:04 -0700 (PDT), marjbell@gmail. com wrote:
      I have a Access database of email addresses that I would like to mass
      email to customers. Can Access be used through Outlook? or can it just
      be done with Access? I know it is possible to use MailMerge for
      snailMail.
      Download
      EmailSenate or EmailSenate2K
      from

      for a working sample database.
      --
      Fred
      Please respond only to this newsgroup.
      I do not reply to personal e-mail

      Comment

      • Tony Toews [MVP]

        #4
        Re: Emailing with Access

        marjbell@gmail. com wrote:
        >I have a Access database of email addresses that I would like to mass
        >email to customers. Can Access be used through Outlook? or can it just
        >be done with Access? I know it is possible to use MailMerge for
        >snailMail.
        Poke about at the Microsoft Access Email FAQ


        You will need to use VBA code to run through a recordset to individually send the
        emails. For sample recordset logic see


        Tony
        --
        Tony Toews, Microsoft Access MVP
        Please respond only in the newsgroups so that others can
        read the entire thread of messages.
        Microsoft Access Links, Hints, Tips & Accounting Systems at

        Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

        Comment

        • Rich P

          #5
          Re: Emailing with Access

          It used to be you could send out emails through outlook from Access, but
          now Outlook has all these security prompts each time you interface with
          Outlook - which makes it pretty much unsuable from/through automation.

          The easiest solution I came up with was to write my own Emailer program
          in VB.Net which contains all the classes required for emailing using
          whatever mail server Outlook would use. I can read the email addresses
          from an Access mdb and then send them out through my emailer program --
          adding a generic subject line/body.

          I realize this is not a .Net forum, but incase anyone cares, here is the
          part of the .Net code which would send out the emails:

          -------------------------------------------
          Imports System
          Imports System.Data
          Imports System.Net.Mail
          Imports System.IO

          Private Sub SendTheEmail()
          Try
          Dim Client As SmtpClient
          Dim Message As MailMessage
          Dim strRegex As String
          strRegex =
          "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-
          Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
          Dim Expression As New System.Text.Reg ularExpressions .Regex(strRegex )

          Message = New MailMessage
          Message.From = New MailAddress(txt From.Text)

          For Each dr As DataRow In tblEmail.Rows
          '--validate email before adding to Send Email list
          If Not Expression.IsMa tch(dr("Email") .ToString) Then
          Throw New System.Exceptio n("Invalid Email Address Exception has
          occured for " & dr("ID_Main").T oString & " " & dr("Email").ToS tring)
          Else
          Message.To.Add( New MailAddress(dr( "Email").ToStri ng))
          End If
          Next

          Message.Subject = txtSubject.Text
          Message.Body = rtbBody.Text

          Message.IsBodyH tml = True '-- use this if formatting with
          '--html tags else exclude this line

          '--my Outlook was using the comcast email server
          Client = New SmtpClient("mai l.comcast.com")

          Client.Send(Mes sage)
          MessageBox.Show ("done sending mail!")

          Catch ex As Exception
          MessageBox.Show (ex.ToString, "Problem with Email",
          MessageBoxButto ns.OK)
          End Try
          End Sub
          ----------------------------------------------

          tblEmail is a .Net dataTable contained in the Emailer program which
          contains the email addresses to mail to imported from an Access mdb.

          This .Net program could also be created as a DLL which could be
          referenced from an Access mdb, and actually, I could have eliminated the
          .Net loop and just looped in Access -- calling the .Net dll for each
          iteration of the loop. But instead I just read the whole table into the
          .Net program and just emailed everything in one shot. The .Net program
          also performs email validation using a Regular Expression - which this
          could also be done directly in Access by Referencing RegEx in
          Tools/References.

          Rich

          *** Sent via Developersdex http://www.developersdex.com ***

          Comment

          • marjbell@gmail.com

            #6
            Re: Emailing with Access

            On Apr 29, 11:46 am, fredg <fgutk...@examp le.invalidwrote :
            On Tue, 29 Apr 2008 11:30:04 -0700 (PDT), marjb...@gmail. com wrote:
            I have a Access database of email addresses that I would like to mass
            email to customers. Can Access be used through Outlook? or can it just
            be done with Access? I know it is possible to use MailMerge for
            snailMail.
            >
            Download
            EmailSenate or EmailSenate2K
            fromhttp://www.datastrat.c om/DataStrat2.html
            for a working sample database.
            --
            Fred
            Please respond only to this newsgroup.
            I do not reply to personal e-mail
            That is very cool! Unfortunately, I don't know VBA well enough to
            change it to suit it to an individual database. Thank you for your
            help. I checked out the click event, and saw what I think might have
            to be changed. But I am not sure how to do it. For all I know there
            might be more to change than what I think too. Any suggestions?

            Comment

            • marjbell@gmail.com

              #7
              Re: Emailing with Access

              On Apr 29, 11:42 am, timmg <tmillsgronin.. .@gmail.comwrot e:
              On Apr 29, 1:30 pm, marjb...@gmail. com wrote:
              >
              I have a Access database of email addresses that I would like to mass
              email to customers. Can Access be used through Outlook? or can it just
              be done with Access? I know it is possible to use MailMerge for
              snailMail.
              >
              You may want to consider using MS Word.  Create the document as you
              would any mail merge using a query of your Access data as the data
              source.  Select "Merge to Email" as your output option.
              >
              I like this approach because it allows personalization of the outgoing
              message ("Dear Tim, you've been a member of XYZ for 12 years") and
              it's easy to assign the task to any staff person (all they really need
              to know if Word).
              >
              Note that your ISP may not like the volume of messages going out
              through Outlook/Exchange and it can take a while to cycle through
              several thousand records.  Then you'll have to sort through the
              undeliverable/returned mail, but that can be quite an education about
              your customers.
              >
              For a large volume solution you may want to look at a commercial email
              service such as Constant Contact or similar.
              >
              Good luck,
              >
              Tim Mills-Groninger
              Thank you for your suggestion. Yes, I believe that would work whether
              it was in Word or Excel. But as you say it would be a lot of training
              for my customer.

              Comment

              • Paul Brady

                #8
                Re: Emailing with Access

                On Tue, 29 Apr 2008 11:30:04 -0700 (PDT), marjbell@gmail. com wrote:
                >I have a Access database of email addresses that I would like to mass
                >email to customers. Can Access be used through Outlook? or can it just
                >be done with Access? I know it is possible to use MailMerge for
                >snailMail.
                Create a query that has, as one of its fields, a variable which I will
                call "OutlookEMa il". The source of this query is a list of names,
                from either a table or another query, that includes a field that has
                the regular email address, such as pope@vatican.go v. The new field you
                will create has, as its header in your query setup, looking like this:

                OutlookEmail: '"' & [FirstLine] & '" <' & [EmailAddress] & ">"
                The thing that looks like three apostrophes is:
                single quote, double quote, single quote. (the single quotes are used
                to bracket the double quote so that the double quote will not be
                interpreted as a special character.) FirstLine is the name of the
                person, such as "Benedict". The expression following the second
                ampersand is single quote, double quote, space, <, single quote. This
                will produce a line looking like:
                "Bendict" <pope@vatican.g ov>
                You will then have a column in your output consisting of the first
                line being "OutlookEma il", and then underneath it,
                "Benedict" <pope@vatican.g ov>, "dubya" president@white house.gov, and
                so on. Select this column and put the column on your clipboard.
                THEN: Get into Outlook and paste the clipboard into either the "To"
                field or the BCC (blind carbon copy) field. Manually remove the top
                entry, ie, delete "OutlookEma il" (this isn't a legitimate email
                address).
                You can simplify this if you don't want the aliases in your
                Outlook list. If the query simply has the email addresses, you could
                have the query simply list the email addresses (without the "pope"
                etc). Again, copy the column onto the clipboard and paste it into
                Outlook.
                The main point here is that the clipboard is your useful tool
                for doing this. You don't need to delve into the bowers of Access and
                Outlook to link your two programs.
                Pete Brady

                Comment

                • Harry Skelton

                  #9
                  Re: Emailing with Access

                  marjbell@gmail. com wrote:
                  I have a Access database of email addresses that I would like to mass
                  email to customers. Can Access be used through Outlook? or can it just
                  be done with Access? I know it is possible to use MailMerge for
                  snailMail.
                  I had a problem running VB and creating reports, so what I did was to
                  create a form with the information I wanted on it. I would display all
                  but the e-mail address. I would have one button that would allow me to
                  fire off the e-mails. The code would do:

                  - set the button to invisible.
                  - go to the first record in the set (use a DoCmd for this)
                  - use another DoCmd to send the e-mail to the person in the email
                  address. Send as a Snapshot.
                  - Use another docmd to go to the next record
                  - check to see if the e-mail adress is NULL (if so, stop the program)
                  then go to the first line again.

                  That would limit your coding.

                  The other option is to make a report that selects only one record from
                  the query. You could have a form that fires the code

                  ' get the current record
                  ' run a docmd to run the report,with the option to SendTo and where clause
                  ' move to the next record (again with a do cmd)
                  ' wash, rinse, repeat...

                  If you don't want to dirty your hands with code, then I think you are
                  out of luck. You could drop down a level and use macros, but code is
                  cleaner, and you can debug it while running.

                  Be sure to be liberal with the DoEvents otherwise you will hang your
                  system and flood some unsuspecting schmuck with a bunch of e-mail.
                  Open a few accounts on mail.google.com and mail to them to see how it
                  comes out.

                  Comment

                  Working...