Redemption Outlook Process Code Gets Stuck in Draft Folder

I have 2 problems:
1. Upon execution, with the .Save command line, this code get's stuck in Outlook's Draft folder and does not get sent; however, .Send will only send the first recipient in the list
2. I would like to use the .From line (currently commented out), but this makes the entire code fail - with no error messages

Here's the code:
Private Sub Reminder_Click()
    Dim rs          As DAO.Recordset            ' recordset of suppliers (for email address)
    Dim objOutlook  As Object                   ' outlook object
    Dim objMessage  As Outlook.MailItem         ' outlook mail message
    Dim strOrder    As String                   ' string of order details
    Dim objSafeMail As Object
    On Error GoTo SendObject_Error
    Set objOutlook = CreateObject("Outlook.Application")
    Set rs = CurrentDb.OpenRecordset("SELECT* FROM qryEmail WHERE tblRegistrants.AddressID= " & Me!AddressID)

    While Not rs.EOF
        strOrder = "ENROLLMENT REMINDER" & _
            vbCrLf & vbCrLf & _
            "You are scheduled to attend the class on " & [CRSE] & " held " & [CourseDate] & " @ " & [StartOfCourse] & " - " & [EndOfCourse] & ". " & _
            vbCrLf & vbCrLf & _
            "IMPORTANT" & _
            vbCrLf & _
            "If for some reason you need to cancel, please reply to this email or call me @ (000) 000-000.  Some classes have a waiting list and others may wish to take your spot.  Please give them the opportunity to do so." & _
            vbCrLf & vbCrLf & _
            "Thank you." & _
            vbCrLf & vbCrLf & _
            vbCrLf & _
            "Blagh" & _
            vbCr & _
            "Blah" & _
            vbCr & _
            "blah, Inc." & _
            vbCr & _
            "blah" & _
            vbCr & _
            "000-000-0000 Office"
        If Not IsNull(rs("Email")) Then
          Set objMessage = objOutlook.CreateItem(olMailItem)
            With objMessage
                .To = rs("Email")
                '.From = ""
                .Subject = "ENROLLMENT REMINDER !  -  " & [CRSE] & " on " & [CourseDate] & ""
                .BodyFormat = olFormatHTML
                .HTMLBody = "<HTML><HEAD><TITLE></TITLE></HEAD><BODY><FONT face=Verdana><FONT size=2><STRONG><U>ENROLLMENT REMINDER</STRONG></U><BR><BR>You are scheduled to attend the class on <FONT color=#0000ff><b>" & [CRSE] & "</FONT></B> held <FONT color=#0000ff><b>" & [CourseDate] & "</FONT></B> @ " & [StartOfCourse] & " - " & [EndOfCourse] & ".<BR><BR><STRONG><U>IMPORTANT</U></STRONG><BR>If for some reason you need to cancel, please reply to this email or call me @ (000) 000-0000.  Some classes have a waiting list and others may wish to take your spot.  Please give them the opportunity to do so.<BR><BR>Thank you.<BR><BR><BR><B>blah<BR><U>lah</U></B><BR>blah, Inc.<BR>blag<BR>(000) 000-0000 Office</FONT></BODY></HTML>"
                .Importance = olImportanceHigh  'High importance
            End With
        End If
        Set objSafeMail = CreateObject("Redemption.SafeMailItem")
        objSafeMail.Item = objMessage

    ' tidy up
    Set rs = Nothing
    Set objOutlook = Nothing
    Set objMessage = Nothing

    If Err.Number = 2501 Then
       MsgBox "You have cancelled the e-mail; thus, it was not sent.", vbInformation, "Notice!"
   End If
End Sub
Who is Participating?
Helen FeddemaConnect With a Mentor Commented:
The Redemption Library is no longer needed in Access 2007 (at least, if you have the latest updates).  I guess Microsoft heeded the complaints about the Object Model Guardian!  So you can remove the code that uses Redemption objects and just use regular Outlook objects, and the message should go into the Outbox and be sent (in that case, use msg.Send, not just Send).

For the problem with the From line, this is one of those annoying Outlook field name mismatches.  The field is shown as From in the interface (even in Design view), but in code it is SentOnBehalfOfName.  You can try setting that property, but I am not sure whether it can be set manually.

eossmaAuthor Commented:
Actually, I retract item number 1.  It works, it just works really slow.

However, I will still provide the 500 points if someone can tell me why the from line doesn't work, and how can i get it to work?

Additional infor that might help.  I have two email accounts tied to my Outlook account.  One is my personal company account (set as the default in Outlook), the second is my department's general email address.  I would like to use the latter for the code above.  Why doesn't it work?
Helen FeddemaConnect With a Mentor Commented:
I meant Office 2007 -- I assume you have the same version of Outlook and Access.
eossmaAuthor Commented:
.SentOnBehalfOfName = ""
doesn't work.  It ignores this statement and sends it from me defualt email address.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.