Results 1 to 15 of 15
  1. #1
    Join Date
    Oct 2007
    Posts
    13

    Unanswered: Pls, need help making Access send email notifications

    Hello to everyone, this is my first post here, I really need help with this issue:

    We are developing a small MS Access app to our users and they are requesting email notifications. This developed work will be located in our MS Windows 2003 server, we have DynDns MailHop service, and that's the one that we're using to send emails from different locations. So, how can I manage in MS Access to send email to an specified email address? And also these email notifications will be including attachments which are located from the same server.

    Thanks, very much.
    JC.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Oct 2007
    Posts
    13
    Quote Originally Posted by pkstormy

    Hi pkstormy,

    Is it also possible to send these emails in background without user interaction? I mean my system will be sending email alerts when a buttom has been pressed or activated, things like that, is it possible?

    Thanks.

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Sure...just about anything is possible - question is, how do you want to do it? When you ask how to send these emails in background without user interaction, what do you mean? In Access, you can utilize a timer event to do anything at a specific time (but you must be in Access.) In Windows Schedular, you can make things happen at a specific time (without anything to do with Access.)

    Could you give a little more detail on how you want to go about this? It's a little vague yet.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Oct 2007
    Posts
    13
    Hi pkstormy,

    Yes sure,

    Our business works along with CADIVI (Foreign Exchange Administration Commission.)

    There are bunch of process that we are trying to record when user inputs their information, so everytime they record an action I need to have Access send email notifications if a process has taken too long, it's some sort of alert to their mail inboxes.

    Hope this helps,

    Best Regards,
    J.

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    ok....

    So the situation is that users are entering something into an ACCESS form and if a function or some other calculation is taking a long time when they are entering a new record, you want to fire off an email in the background?

    If that is correct, here's how I might go about it...Set a "timer-type" variable on the form which when the user starts entering info in a new record, starts keeping a count of the time, like a stopwatch (you can do this utilizing the timer event (you may want to read up on the timer event) where you increase the variable (ie. variable = variable + 1) or something like that. If the variable reaches a certain time, call the function which fires off the email in the background. If not and the record is entered ok, set the variable to 0 and wait for the entering to start on the next record to start the timer event again.

    I didn't get into specific details here because there is a lot of variance on what your asking and how it can be done.
    Last edited by pkstormy; 10-23-07 at 12:51.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Oct 2007
    Posts
    13
    Hi pkstormy

    Yes that's the logic of our system to be developed within the next days.

    So, having the logic understood, please I need to know the following:

    Which function would you suggest to send these backgound email notifications?

    THank you.

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You can utilize the docmd.sendobject function (as in the example) to fire off the email. There are parameters you can set with the sendojbect command to make it silently send out the email without user interaction.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #9
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    docmd.sendobject is the main vba command in Access for sending out emails via Outlook.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  10. #10
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    The example shows you how to create an emailing list in a table and using the docmd.sendobject, loop through the table sending an email to each person in the table.

    The part you would need to program in is the timer function on the form and when to call the function in the example.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  11. #11
    Join Date
    Oct 2007
    Posts
    13
    Hi pkstormy very useful your help, we are going to try these and we will be responding to you, ok?

    Best regards,
    J.

  12. #12
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    ok...but keep your questions in the forum so everyone can have a shot at answering them. You'll get a better response time and more options.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  13. #13
    Join Date
    Oct 2007
    Posts
    13
    Quote Originally Posted by pkstormy
    ok...but keep your questions in the forum so everyone can have a shot at answering them. You'll get a better response time and more options.

    Sure, I'll be posting right here.

    Thanks.

  14. #14
    Join Date
    Oct 2007
    Posts
    13
    Quote Originally Posted by pkstormy
    ok...but keep your questions in the forum so everyone can have a shot at answering them. You'll get a better response time and more options.

    Hi again pkstormy, in this background email sending notification I'd to like it is could attach a file.

    Thanks.-

  15. #15
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Look at the sendobject help. There is a parameter you can use to attach a specific file.
    Ex:
    DoCmd.SendObject acSendReport, "SomeReportName", [OutputFormat], [To], [Cc], [Bcc], [Subject], [MessageText], [EditMessage], [TemplateFile]

    If you have a new version of Outlook though, Microsoft did away with silently sending emails with attachments (too much spamming and too many vba programmers who abused the intent) and you get a message popup box saying something to the effect..."XXX is trying to send an email with an attachment. Do you want to continue?" and you need to click Yes to continue. There are ways around this which include using another email client such as Blat to send the emails through which includes vba code to access it and send emails with attachments. There isn't an easy Microsoft fix for this though but it is possible.
    Last edited by pkstormy; 10-23-07 at 17:40.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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