Results 1 to 11 of 11
  1. #1
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76

    Exclamation Access 2010 - Form - OnClick, Lotus Notes Opens - Need to submit the Email Silently

    Background
    I'm new to working with Microsoft Access and have created my basic layout of the database. I am trying to create an OnClick command where when a button is clicked an email is sent to a certain individual. I'm able to get the button to work and I have written the VBA as follow:

    Private Sub Close_Form_Click()


    DoCmd.SendObject _
    , _
    , _
    , _
    "emaio.com", _
    , _
    , _
    "Subject here", _
    "Message here", _
    True




    End Sub

    Problem:
    I would like the email to automatically send without the user having to actually click the "send" button in their Lotus Notes. Is this possible???



    Thank you all!

  2. #2
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Again is what I am referring to is submitting the actual email in lotus notes without the user in access knowing that an email is being sent.

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Try changing your TRUE statement at the end to FALSE. I don't know if that works in newer versions of Access, as of 2003 it was not possible to send an email without confirmation from MS access.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    https://www.fmsinc.com/MicrosoftAcce...endObject.html

    According to this that's still the case, if you want to send email without confirmations you may have to employ something like powershell.

  5. #5
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Rpeare: Yes I tried changing the True to False and there is still no change :/

    Do you think there is any other way to do it besides PowerShell?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Maybe with Collaboration Data Objects code. Example:
    Code:
    Dim iMsg As Object
    Dim iConf As Object
    Dim Flds As Variant
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    iConf.Load -1    'CDO Source Defaults
    Set Flds = iConf.Fields
    With Flds
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "IP address of your SMTP server"
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Update
    End With
    With iMsg
        Set .Configuration = iConf
        .To = "email"
        .CC = ""
        .BCC = ""
        .From = "email"
        .Subject = "text"
        .TextBody = "text"
        '.AddAttachment "filepath/name"
        .Send
    End With
    Set iMsg = Nothing
    Set iConf = Nothing
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    I would also like to mention, I will not be the only one using this Access database... there will be over 20 people that will need to click this "silent send email button".

    Does this change anything that there will be more than one person using it?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Variation in code if you want it to use each person's email in the .From parameter.

    If they know there is email sent, why does it have to be 'silent'?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    My preference is CDO. I have some examples of HTML formatted CDO emails somewhere. If you want them, let me know and I will dig them up. Actually, list out all of the business rules so I can include all of the schemas in a single shot.

  10. #10
    Parker is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    76
    Thank you all, and Yes, Itsme that would be great if you can!

    It has to be "silent email" because I want to eliminate a step for the end user. I am utilizing the access database as a Document Center. I would like to have employees upload their documents to this one database I have created, then when they click the submit form button to "save" a record I want this to trigger an automatic email response to their manager. This way the manager knows they need to review a document that was just submitted.

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I don't recommend using an attachment field as a way to store and manage docs. I recommend storing the file path in a text field.

    This is the simplest HTML example I could find. Here is some code that I use to automate a request to clients. It references three controls on the current form, so you may want to hardcode something else or....

    The HTML displays a message, a hyperlink, and a logo. The logo is downloaded from a web server and displays an alt message if the link is broken.

    Also, there is a return receipt request that I commented out.

    Code:
    Dim strPath As String
    Dim strFile As String
    Dim strBillType As String
    Dim strStart As String
    Dim strEnd As String
    Dim strReturn As String
    Dim strTo As String
    Dim strSubject As String
    Dim strBody As String
    Dim iCfg As Object
    Dim iMsg As Object
    strPath = "\\ServerName\Folder\"
    strFile = "FileName.Extension"
    strBillType = Me.cmbServiceType.Column(1)
    strStart = Format(Me.BillPeriodStart.Value, "mmm dd, yyyy")
    strEnd = Format(Me.BillPeriodEnd.Value, "mmm dd, yyyy")
    strReturn = "J.Blow@MyDomain.com"
    strTo = "Name@TheirDomain.com"
    strSubject = "Request for Money Please"
    strBody = "<body>" & vbCrLf & _
              "<p>&nbsp;</p>" & vbCrLf & _
              "<p>Please find the attached request for remittance.</p>" & vbCrLf & _
              "<p>The " & strBillType & " statement for the billing period " & strStart & " to " & strEnd & " is now due.</p>" & vbCrLf & _
              "<p>&nbsp;</p>" & vbCrLf & _
              "<p>&nbsp;</p>" & vbCrLf & _
              "<p><br>" & vbCrLf & _
              "<br>" & vbCrLf & _
              "</p>" & vbCrLf & _
              "" & vbCrLf & _
              "<p>" & vbCrLf & _
              "<p><a href=""http://www.MyDomain.com/"">Visit Our Website</a> " & vbCrLf & _
              "<p>" & vbCrLf & _
              "<img border=""0"" id=""_logoSmall"" src=""http://MyDomain.com/logo/Logo_Email.png"" width=""131"" height=""80"" alt=""Serving the industry since 1909""></p>" & vbCrLf & _
              "<p>Joe Blow<br>" & vbCrLf & _
              "Accounts Payable</p>" & vbCrLf & _
              "" & vbCrLf & _
              "</body>"
    
                
                Set iCfg = CreateObject("CDO.Configuration")
                Set iMsg = CreateObject("CDO.Message")
                
                
                With iCfg.Fields
                
                .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.MyDomain.com"
                .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
                .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "automated@MyDomain.com"
                .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Password"
                .Item("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "Joe Blow <J.Blow@MyDomain.com>"
                
                .Update
                End With
    '            Const cdoDispositionNotificationTo = "urn:schemas:mailheader:disposition-notification-to"
    '            Const cdoReturnReceiptTo = "urn:schemas:mailheader:return-receipt-to"
                With iMsg
                .Configuration = iCfg
    '            .Fields(cdoDispositionNotificationTo) = strReturn
    '            .Fields(cdoReturnReceiptTo) = strReturn
    '            .Fields.Update
                .Subject = strSubject
                .To = strTo
                .Bcc = strReturn
                .HTMLBody = strBody
                .AddAttachment strPath & strFile
                .Send
                End With
                
                Set iMsg = Nothing
                Set iCfg = Nothing
                
    MsgBox "The Email Was Sent"

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

Similar Threads

  1. Replies: 3
    Last Post: 01-31-2014, 04:34 PM
  2. Replies: 19
    Last Post: 10-26-2012, 11:33 AM
  3. Lotus Notes Automation
    By manic in forum Programming
    Replies: 10
    Last Post: 03-30-2012, 02:55 PM
  4. Replies: 3
    Last Post: 03-08-2012, 04:43 PM
  5. Import Lotus Notes address book into a MS Access table.
    By acheo in forum Import/Export Data
    Replies: 0
    Last Post: 02-19-2007, 02:43 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