Hi All,
I'm using a code somebody posted here. I extract the records from a
query which gave me just the entries for the current date, there will
be maximum 5-6 entries per days and I need to send them as the body of
an email. The code partially works and what happens is that it will
send an email per every record when what I need is to send just an
email, at the end of the day, including all the entries made(Rack,
CompanyName and ComponentName are the records from the query). I want
to try moving "pst.send" below ".MoveNext" this is an idea that just
ocurrs to me, I don't know it will works, I just started taking vb
classes, kind of a beginner. Here is the code I'll appreciate if
someone can help me:
************************************************** **************************
Sub sendEmail()
Dim olk As Outlook.Application
Dim pst As Outlook.MailItem
Dim rst As Recordset
Dim db As Database
Dim usr As Variant
Set db = CurrentDb
Set rst = db.OpenRecordset("ASPComponentShipped")
Set olk = CreateObject("outlook.application")
With rst
Do Until .EOF
usr = "pi************@epi.epson.com"
Set pst = olk.CreateItem(olMailItem)
With pst
.ReadReceiptRequested = False
.To = usr
.Subject = "ASP Component Shipped"
.Body = "EAI Gemini Support," & vbCrLf & vbCrLf &
"The following ASP component requests were fullfilled today:" _
& vbCrLf & vbCrLf & Rack & " " & Companyname & " "
& ComponentName _
& vbCrLf & vbCrLf & "Sincerely," & vbCrLf & "EPI
Gemini Support"
.Send
End With
.MoveNext
Loop
End With
End Sub