Error in sending email.

frankbutcher

Registered User.
Local time
Today, 16:00
Joined
Aug 6, 2004
Messages
192
Hi
I have a button on a form which sends an email out automatically.
I recently had to re-install Vista on my laptop, and after I did that, the button does not work. It was working perfectly fine before, but not after.
All others aspects of the DB seem to work fine.

The code is below. and was sourced from another thread a while back....

-------------------------------------

Private Sub Command67_Click()
On Error GoTo Err_Command67_Click
Dim strMailto As String ' email address
Dim strMailcc As String ' email address
Dim strSubject As String 'This is for the subject line in the e-mail
Dim strMessage As String 'This is for the email message text


strMailto = "mdmin@abc.com"
strMailcc = "projects@abc.com"
strSubject = "Quotation Number " & Me.ProjectNo & " can now be loaded"
strMessage = "All" & vbCrLf & vbCrLf & "Quotation Number " & Me.ProjectNo & " can now be loaded." & vbCrLf & vbCrLf & "All relevant information is in the folder"

DoCmd.SendObject , , "RichTextFormat(*.rtf)", strMailto, strMailcc, "", strSubject, strMessage, True, ""

Command67_Click_Exit:
Exit Sub

Err_Command67_Click:
If MsgBox("The Email has not been sent, errors have occured", vbQuestion, "Change Status") = vbNo Then

DoCmd.CancelEvent

End If

End Sub

-----------------------------------------
I just get the MsgBox appear (The email has not been sent.... etc etc)

Anyone got any ideas? Would it be a laptop problem rather than a DB one as it was working previously?

Thanks.

Frank.
 
I have another DB which uses the same sort of code, and it is doing the same.

When I stripped down the code, it was high lighting this line:-

DoCmd.SendObject , , "RichTextFormat(*.rtf)", strMailto, strMailcc, "", strSubject, strMessage, True, ""
 

Users who are viewing this thread

Back
Top Bottom