Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.SendObject Failure After Initial Success 1

Status
Not open for further replies.

caper64

IS-IT--Management
Apr 22, 2002
2
US
I've tied the code below to a button on an Access (v. 2000) form that is used to send an email notification from Outlook (v. 2000). It works great; populates the subject field, pulls values from the various form text boxes just like it should, but it only works a few times and then it won't work at all. The number of times it works is inconsistent, usually at least twice. I have to shut down Access, and when I restart it works again just fine, two or three times. When it stops working there are no error boxes or any clues as to the problem, it just won't compose another email. Has anyone had and solved a simillar problem? I'd appreciate any suggestions....

I'm using Windows 2000 SP-2.


Private Sub Command164_Click()
DoCmd.RunCommand acCmdSaveRecord
Dim receiver As String
Dim st1 As String
Dim st2 As String
Dim st3 As String
Dim st4 As String
Dim st_full As String
receiver = Me!txt_email
st1 = ""
st2 = ""
st3 = ""
st4 = ""
st1 = "The job you submitted on " & Me!date_opened & " for" & Chr$(10)
st2 = "Project Number " & Me!project & " WBS " & Me!wbs & Chr$(10)
st3 = "Is ready for pick-up." & Chr$(10)
st4 = "The job was described as: " & Me!description
st_full = st1 & st2 & st3 & st4
DoCmd.SendObject , , , receiver, , , "Your Request #" & Me!job_id & " is Ready for Pick-up", st_full, 1
receiver = ""
End Sub
 
Perhaps the following applies to you:

The Microsoft Knowledge Base has this article: Q260819 - ACC2000: SendObject Method Fails in Access 2000.

To summarize:
SYMPTOMS
The SendObject method silently fails. That is, the message is not sent, and you do not receive any error message or notification that the message was not sent.
CAUSE
There are too many characters in the message. This behavior has been documented with messages that contain between 98 and 2268 characters.

Article Q161088 - Using Automation to Send a Microsoft Outlook Message offers a workaround, but it is limited in that the client must use Outlook as his email application.
 
I had a problem with SendObject causing illegal operation. I was looking for another way to send e-mail anyway. I created a tip in this forum called 'dll for e-mail'. It is an alternative method using a third-party dll. That's one thing you can try if you wish. Winsock is a good way to do it, too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top