Results 1 to 2 of 2
  1. #1
    mafhobb is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    6

    Windows 7 and smtp mail with Access 2003

    Hi



    I designed a database a few years back that sends automatic e-mail though the smtp port. This is because we use Novell Groupwise instead of Outlook.

    This is the code:
    Code:
     rst.Close
        dbs.Close
        Set rst = Nothing
        Set dbs =  Nothing
    
    Set mail = Nothing
    
    ' Send by connecting to port 25  of the SMTP server.
    Dim iMsg
    Dim iConf
    Dim Flds
    Dim strHTML
    Dim  strEmailTo
    
    Const cdoSendUsingPort = 2
    
    Set iMsg =  CreateObject("CDO.Message")
    Set iConf =  CreateObject("CDO.Configuration")
    
    Set Flds = iConf.Fields
    
    '  Set the CDOSYS configuration fields to use port 25 on the SMTP server.
    
    With  Flds
         .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") =  cdoSendUsingPort
        'ToDo: Enter name or IP address of remote SMTP  server.
         .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =  "10.1.10.63"
         .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")  = 10
        .Update
    End With
    
    ' Build HTML for message body.
    strHTML  = "<HTML>"
    strHTML = strHTML & "<HEAD>"
    strHTML =  strHTML & "<BODY>"
    strHTML = strHTML & "<b>  </b></br>"
    strHTML = strHTML & "</BODY>"
    strHTML  = strHTML & "</HTML>"
    
    ' Apply the settings to the  message.
    With iMsg
        Set .Configuration = iConf
        .To =  strEmailAddress
        .cc = CarbonCopy
        .From = "Airplane R&D  Database. R&D Staff Entry." 'MailFrom 'this should be OK
         .Subject = "R&D ID# " & RDID & ".  " & ProjectName &  ". By " & Commentby
        .HTMLBody = TestInput  'this should be  OK
        .Send   'this should be OK
    End With
    
    ' Clean up  variables.
    Set iMsg = Nothing
    Set iConf = Nothing
    Set Flds =  Nothing
    This has been working flawlessly for a few years until now. One user has been upgraded to Windows 7, and since this happened, when the db attempts to send an e-mail from his computer, he gets the following message: "Runtime error -2147220979(8004020d) At least one of the froms or sender fields is required"

    Please note that everyone else is still able to send e-mails normally, so the code works...

    Does anyone know what is happening? Why would the code work on XP and create problems on Windows 7?

    Thanks

    mafhobb

  2. #2
    mafhobb is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    6
    It is the .send that is triggering the error.

    Suggestions?

    mafhobb

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

Similar Threads

  1. Replies: 2
    Last Post: 05-19-2010, 02:01 PM
  2. Replies: 16
    Last Post: 03-15-2010, 12:02 AM
  3. Access 2003 and Windows 7
    By icedude in forum Access
    Replies: 4
    Last Post: 02-03-2010, 03:18 PM
  4. Replies: 0
    Last Post: 12-13-2009, 05:15 AM
  5. Replies: 1
    Last Post: 09-06-2006, 11:48 AM

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