When I try to execute the following code from excel I get the messages
returned to me.
with the following message returned back. I can execute the code from
other computers and other accounts without this problem. According to
the server side people all of these accounts are identical so there
should be a problem sending on behalf of. In addition this user can
send on behalf of this address to this person manually, but for some
reason when then VBA runs the emails get sent back to her.
Your message did not reach some or all of the intended recipients.
Payroll Time Card Reports
Sent: 5/15/2008 10:19 AM
The following recipient(s) could not be reached:
Blah,Blah on 5/15/2008 10:19 AM
You do not have permission to send to this recipient. For
assistance, contact your system administrator.
' Begin Sending Email Process...
For I = 7 To Myrange.Rows.Count
For index = 1 To FinalData.Rows.Count
If Myrange.Cells(I, 1) = FinalData.Cells(index, 4) Then
Set NewMessage = myOlApp.CreateItem(olMailItem)
NewMessage.SentOnBehalfOfName = "
.Subject = "Biweekly Payroll Time Card Reports"
' Type message to contact here.
.Body = "Dear " & Myrange.Cells(I, 3) & "," & _
"Thank you! "
.To = Myrange.Cells(I, 4)
NewMessage.Attachments.Add (Rate_File & "_" & _
FinalData.Cells(index, 4) & ".doc")
' Send the message to Resume ClickYes
Res = SendMessage(wnd, uClickYes, 1, 0)
' Send Report to department contact
' Send the message to Suspend ClickYes
Res = SendMessage(wnd, uClickYes, 0, 0)
End With ' NewMessage
Set NewMessage = Nothing
index = FinalData.Rows.Count + 1