vbSendMail 429 error with Attachment


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: vbSendMail 429 error with Attachment

  1. #1
    Join Date
    Apr 2009
    Posts
    2

    vbSendMail 429 error with Attachment

    Hello,

    I have installed vbSendMail.dll and mswinsck.ocx and registered them using REGSVR32.

    I am calling vbSendMail from MS Access 2007 VBA code. The code correctly generates an email if I do not specify an attachment. However, when I specify an attachment, error 429 is encountered.

    I have tried unregistering and reregistering vbSendMail.dll and mswinsck.ocx but that did not help.

    I tried using GetShortName, but that did not help.

    Windows XP SP3

    MS Access 2007 VBA code:
    Code:
    Option Compare Database
    
    Public objSendMail As vbSendMail.clsSendMail
    
    Declare Function GetShortPathName Lib "kernel32" _
                Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _
               ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
    
    Function GetShortName(ByVal sLongFileName As String) As String
               Dim lRetVal As Long, sShortPathName As String, iLen As Integer
               'Set up a buffer area for the API function call return.
               sShortPathName = Space(255)
               iLen = Len(sShortPathName)
        
               'Call the function.
               lRetVal = GetShortPathName(sLongFileName, sShortPathName, iLen)
               'Remove unwanted characters.
               GetShortName = Left(sShortPathName, lRetVal)
     End Function
    
    Function SMTPproc()
    
    Dim strMailTo As String
    Dim strMailSubject As String
    Dim strMailMsg As String
    Dim strMailAtt As String
    Dim strMailCc As String
    
    strMailTo = "abc1@def.com"
    strMailSubject = "This is the subject of the email"
    strMailMsg = "This is the body text of the email"
    strMailAtt = "D:\readme.txt"
    strMailCc = "abc2@def.com"
    
    Set objSendMail = New vbSendMail.clsSendMail
    
    objSendMail.SMTPHost = "mail.isp.com"
    
    objSendMail.UseAuthentication = False
    'objSendMail.Username = "emailUserName"
    'objSendMail.Password = "thepassword"
    
    'objSendMail.RecipientDisplayName = ""
    objSendMail.ReplyToAddress = "abc3@def.com"
    objSendMail.CcRecipient = strMailCc
    objSendMail.from = "abc4@def.com"
    objSendMail.FromDisplayName = "System Support"
    objSendMail.Recipient = strMailTo
    objSendMail.Subject = strMailSubject
    objSendMail.Message = strMailMsg
    
    ' Tried GetShortName, but it did not help, even with a long path...
    ' The error 429 occurs even with D:\readme.txt...
    'objSendMail.Attachment = GetShortName(strMailAtt)
    objSendMail.Attachment = strMailAtt
    
    objSendMail.Send
    Set objSendMail = Nothing
    
    End Function

  2. #2
    Join Date
    Apr 2009
    Posts
    2
    After a reboot, it worked as expected. The good old reboot.

Similar Threads

  1. Saving attachment to text in Outlook
    By vicks in forum VB Classic
    Replies: 0
    Last Post: 03-03-2006, 07:55 AM
  2. vbsendmail component..where n how?
    By yuvarajvima in forum VB Classic
    Replies: 0
    Last Post: 02-05-2006, 01:28 PM
  3. implements SMTP send an attachment
    By coolmancool in forum Java
    Replies: 1
    Last Post: 05-21-2005, 03:30 AM
  4. Adding attachment
    By Moon in forum VB Classic
    Replies: 2
    Last Post: 04-01-2001, 10:46 PM
  5. Can Exchange drop attachment names?
    By JohnN in forum Enterprise
    Replies: 1
    Last Post: 02-16-2001, 06:35 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center