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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error: [Filename.mdb] can't send this email message 2

Status
Not open for further replies.

RonMcIntire

Technical User
Oct 12, 2002
166
US
What's going on here?

Access program I've been using for years now throws an error message ". . .can't send this email message" when I try to email a message to individuals in my database.

Windows 8.1 64bit
Windows update thru December rollup.
MS Office 2007 Pro (Purchased license from Ebay)
Access File saved in 2003 format
Have not tried any fixes because I don't fully understand suggested fixes found on google.

Basically, I create a report with my data then with sendobject send the attached data to my recipients.

Here's my code:
Private Sub cmdPrintRec_Click()
On Error GoTo Err_cmdPrintRec_Click

Dim strDocName As String
Dim strWhere As String
Dim strMsg As String
Dim strMsg1, strMsg2, strMsg3, strMsg4, strMsg5 As String
Dim strCCTo, strBCCTo, strSubject As String

strDocName = "rptDIRECTORY Check"
strWhere = "[MemberID]=" & Me!MemberID
strMsg1 = "It's time to review and update the chapter directory again."
strMsg2 = "Please look over each item in the attached file and let me know WHETHER OR NOT there are any changes."
strMsg3 = "* * * IF ANY INFORMATION HAS CHANGED, BE SURE TO CONTACT THE CHAPTER SECRETARY SO HE CAN NOTIFY THE SOCIETY. * * *"
strMsg4 = "Thanks,"
strMsg5 = "Ron McIntire" & Chr(10) & Chr(13) & "Chapter Directory Editor"

strMsg = Me.NICKNAME & ":" & Chr(10) & Chr(10) & Chr(13) & strMsg1 & Chr(10) & Chr(10) & Chr(13) & strMsg2 & Chr(10) & Chr(10) & Chr(13) & strMsg3 & Chr(10) & Chr(10) & Chr(13) & strMsg4 & Chr(10) & Chr(10) & Chr(13) & strMsg5
strCCTo = "RAMcIntire@comcast.net" 'Additional email addreses go here
strBCCTo = "" 'Additional blind email addrresses go here

DoCmd.OpenReport strDocName, acPreview, , strWhere

'The next line sends the report in RTF format.
'This can be changed to several formats, search the help file for acFormatRTF.

DoCmd.SendObject acSendReport, strDocName, acFormatRTF, Me!nEmail, strCCTo, strBCCTo, "Chapter directory update" & " (" & Me.NICKNAME & " " & Me.LNAME & ")", strMsg, -1
'DoCmd.SendObject acSendReport, strDocName, acFormatRTF, Me!nEMAIL, strCCTo, strBCCTo, "Chapter directory update", strMsg, -1


DoCmd.Close
nRecSent = Date

Exit_cmdPrintRec_Click:
Exit Sub

Err_cmdPrintRec_Click:
MsgBox err.Description
Resume Exit_cmdPrintRec_Click

'MsgBox "This form is incomplete." & vbNewLine & vbNewLine & "Modify the code per the in-line comments", , "Send E-Mail"

End Sub
Any help appreciated

Ron
 
Try sending the report through the Access UI and see what happens. Sometimes doing it manually reveals more information.

Some other diagnostic thoughts...

Can you make a new access file and get docmd.sendobject to send a test report object? I am hoping to figure out if it is security / system related or peculiar to your database... If it does work, try creating a different report and see if that works.

Honestly though after they "secured" it, I skip the native MAPI calls and use CDO to send e-mails. You will need an SMTP server that will let you send from it to go down that path.

 
Are you sure that

Me!nEmail

is returning a legitimate email address?

(as an aside, neither

[tt]Dim strMsg1, strMsg2, strMsg3, strMsg4, strMsg5 As String[/tt]

nor

[tt]Dim strCCTo, strBCCTo, strSubject As String[/tt]

are doing quite what you think they are. Unlike say QBAsic , unless individually explicitly dimmed with a type, variables will default to variants)
 
lameid:
Thank you for your response.
One thing I didn't mention was that I use comcast.net as my email server and they require the IMAP (993 portal, SSL encryption) to send and SMTP (587 or 465 portal, SSL or TLS encryption) to send and receive emails. Don't know if this means anything. I use comcast because I can send and receive emails from my desktop and my laptop and access the same emails from either machine.

I use the 2003 version of Access on my desktop and the 2007 version on my laptop. The program worked on both a year ago but now it doesn't work on the laptop. I have an ASUS laptop and have replace my DVD drive with an SSD drive since I ran the program last year but don't think that is a factor.

I'm a neophyte at email systems so don't fully understand your suggestions except that I only have an IMAP option of sending.

stronm:
Thank you for your response.
I developed my email code from code I found on the internet and what I understood at the time. Unfortunately my coding abilities have cooled in the last few years so do not fully understand your suggestions.

Thank you both for your help. I suspect my problem is rooted in comcast so for now I ill use my workaround and send emails from my desktop and use both for processing my emails from either machine.

Thanks again for your help.
Ron McIntire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top