First of all, there was no problem sending email under Access 97.
Now, with Access 2000, when an email function is initiated, one of the following random outcomes results:
1. Run-time error 2501
2. Run-time error 2958
3. No error - email sent - msgbox alert that email was sent.
4. No error - email held in Outlook Outbox - msgbox alert that email was sent
5. No error - no email sent - msgbox alert that email was sent
With further testing, for some reason, items 1 and 2 above have ceased, but 3, 4 and 5 persist. (I have no idea why).
It appears that initially (after a clean start of Access and Outlook) the email will either be sent or get hung up in the Outlook Outbox.
After 1 or 2 further attempts, the email doesn't get sent at all. The DoCmd.SendObject command is completely ignored and the following Msgbox("Mail was sent") is executed. I have put this in debug mode and verified that the DoCmd is being touched and that there are values associated with the command variables.
The code I am using is
DoCmd.SendObject , , , strRecipient, , , strSubject, strMessage, False
MsgBox ("Email has been sent!")
I have experimented using a different email procedure, but ended up with the same results.
(See MS article Q161088 on Automation)
Can anyone help me get this email function working again?