It is necessary to send e-mail from Access 2007 using CDO.Message
and in the TextBody get/add all results/records of recordset
Part of the code as follows:
and in the TextBody get/add all results/records of recordset
Part of the code as follows:
Code:
Private Sub btn1_SendDA_Click() On Error GoTo btn1_SendDA_Click_Error Dim Rst As ADODB.Recordset Dim strSQL As String Set Rst = New ADODB.Recordset strSQL = "select * from [qryDA-REQUEST]" 'source of recordset Rst.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic Do While Not Rst.EOF Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Test Message" objMessage.From = """SENDER"" <sendermail@hotmail.comm>" objMessage.To = "receivermail@gmail.com" objMessage.TextBody = ????? '(all records from Rst) '........ extracted SMTP server configuration objMessage.Send Rst.MoveNext Loop Rst.Close Set Rst = Nothing .......
Comment