In Access 2003, I could test the emails and either get an error message or the email went through. In Access 2007 and Outlook 2007, I get no error message and the email appears to have gone through. Here is the code:
-------------------------------
Function SendEmailNotice(EmailTo As String, EmailSubject As String, Msg As String, Student As String, School As String)
'This works with redemption.dll
'1) register redemption.dll (regsvr32)
'2) Add reference redemption.dll
'3) Also requires reference to Microsoft Outlook Object Library
'Debug.Print Msg
Dim SafeItem, oItem
'Set oItem = Application.CreateItem(0) 'Create a new message
Set objOL = New Outlook.Application
Set oItem = objOL.CreateItem(olMailItem)
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.add EmailTo
SafeItem.Recipients.ResolveAll
'SafeItem.from = "whoever@hotmail.com" --From is no longer used with latest version of Redemption
'SafeItem.SenderName = "Test" --Cannot change sender info
SafeItem.Subject = EmailSubject
SafeItem.Body = Msg
'SafeItem.Attachments.Add "C:\Temp\attachment.txt"
SafeItem.Send
End Function
-------------------------------
Function SendEmailNotice(EmailTo As String, EmailSubject As String, Msg As String, Student As String, School As String)
'This works with redemption.dll
'1) register redemption.dll (regsvr32)
'2) Add reference redemption.dll
'3) Also requires reference to Microsoft Outlook Object Library
'Debug.Print Msg
Dim SafeItem, oItem
'Set oItem = Application.CreateItem(0) 'Create a new message
Set objOL = New Outlook.Application
Set oItem = objOL.CreateItem(olMailItem)
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.add EmailTo
SafeItem.Recipients.ResolveAll
'SafeItem.from = "whoever@hotmail.com" --From is no longer used with latest version of Redemption
'SafeItem.SenderName = "Test" --Cannot change sender info
SafeItem.Subject = EmailSubject
SafeItem.Body = Msg
'SafeItem.Attachments.Add "C:\Temp\attachment.txt"
SafeItem.Send
End Function