Sending mails to ids stored in a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neosam
    New Member
    • Mar 2008
    • 47

    Sending mails to ids stored in a table

    Hi there,

    Its me again with my silly questions. But this thing has been bogging my head for quite some time. I have a form and when it loads a mail is sent with a report to email ids listed in a table. I am able to send it to only the email id in the first field of the table. The code i used is :
    Code:
    data = DLookup("[Email_Address]", "TableName", "[Email_Address] <> ' '")
    DoCmd.SendObject acSendReport, , acFormatXLS, data, , , "report", "Pls find Report", False
    Pls let me know what is wrong...
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    NeoSam, you give very little away :S

    What format is your data held in?

    What do you expect this code to do for you?

    I see nothing in the code that indicates there is anything more than a single address being used. In this case it seems obvious that only one recipient would receive the email.

    Comment

    • neosam
      New Member
      • Mar 2008
      • 47

      #3
      Originally posted by NeoPa
      NeoSam, you give very little away :S

      What format is your data held in?

      What do you expect this code to do for you?

      I see nothing in the code that indicates there is anything more than a single address being used. In this case it seems obvious that only one recipient would receive the email.

      Well NeoPa... there is a table where email ids of people are stored. there is the name in the first column and the email id in the next. and there are some 8 names and ids in the table. What is required is that on form load an email must be sent to everyone whose ids are there in the table. Is it possible to send mails to everyone is my question....

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        In that case, to answer your first question, what is wrong is that your code only attempts to access one address to use to send the e-mail.

        As far as your most recent question goes, I believe (from checking the help system) that multiple addresses can be used in each of the To, CC & BCC fields simply by separating the values with semi-colons (;) which would be similar to how it is done in your e-mail client.

        I have little experience in this area so I cannot confirm this works as claimed, but coincidentally, I myself may have to find out sooner rather than later as I expect to be working in this area shortly.

        With all the security restrictions in place nowadays that complicate automatic sending of e-mails, I expect that should be loads of fun (NOT!).

        Comment

        Working...