danikuper
Registered User.
- Local time
- Today, 11:09
- Joined
- Feb 6, 2003
- Messages
- 147
Hi there! I've been using this code to send an email directly from my form and it worked great with Outlook 2000. Now that I've upgraded to 2003, the email gets created but the message body is blank!
Here's what I'm using:
Private Sub Image137_Click()
On Error GoTo err_image137_click
Dim strRecipient As String
Dim strSubject As String
Dim strMessage As String
strRecipient = Me.ST_Email
strSubject = "New Activity in Marketing Database"
strMessage = "*** " & CurrentUser & " has assigned a marketing activity for you in the database *** " & vbCrLf & vbCrLf
strMessage = strMessage & "Subject: " & Me.txtExpr2 & " - " & Me.Expr2 & vbCrLf
strMessage = strMessage & "Activity: " & Me.A_Name & vbCrLf
strMessage = strMessage & "Stage: " & Me.AST_Description & vbCrLf
strMessage = strMessage & "Due: " & Me.A_End & vbCrLf
DoCmd.SendObject acSendNoObject, , , strRecipient, , , strSubject, strMessage
exit_image137_click:
Exit Sub
err_image137_click:
If Err.Number = 2501 Then
MsgBox "Email was canceled!", vbInformation
Else
MsgBox Err.Number & "; " & Err.Description
End If
Resume exit_image137_click
End Sub
The To and Subject fields are filled correctly, but the message does not make it to the email. Any ideas why that is happening? Anything changed with Outlook 2003 that I need to update in my code?
Thanks!
Here's what I'm using:
Private Sub Image137_Click()
On Error GoTo err_image137_click
Dim strRecipient As String
Dim strSubject As String
Dim strMessage As String
strRecipient = Me.ST_Email
strSubject = "New Activity in Marketing Database"
strMessage = "*** " & CurrentUser & " has assigned a marketing activity for you in the database *** " & vbCrLf & vbCrLf
strMessage = strMessage & "Subject: " & Me.txtExpr2 & " - " & Me.Expr2 & vbCrLf
strMessage = strMessage & "Activity: " & Me.A_Name & vbCrLf
strMessage = strMessage & "Stage: " & Me.AST_Description & vbCrLf
strMessage = strMessage & "Due: " & Me.A_End & vbCrLf
DoCmd.SendObject acSendNoObject, , , strRecipient, , , strSubject, strMessage
exit_image137_click:
Exit Sub
err_image137_click:
If Err.Number = 2501 Then
MsgBox "Email was canceled!", vbInformation
Else
MsgBox Err.Number & "; " & Err.Description
End If
Resume exit_image137_click
End Sub
The To and Subject fields are filled correctly, but the message does not make it to the email. Any ideas why that is happening? Anything changed with Outlook 2003 that I need to update in my code?
Thanks!