By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

Can't open mailsession... No *real* solution ??

P: n/a
Hi all,

I asked the same question two days ago. Only answer (from Lyle) was a CDO-workaround.
I Googled and Googled for answers and I see again that I am not the only one struggling with this issue.
Lots of hits yes, but lots and lots of these questions with no answer at all...
One 'final' solution is about deleting a regkey, that also in my case does not exist...

Question again:
While trying to send mail from Access a client sees the message:
"Microsoft Access can't open the mail session. Check your mail application ...."
I *know* this message as I had the *very same* message when using Access 97 while Access2000 was installed too.
The 'solution' for me has been to use Access2000, and... no problemo anymore.

BUT this client *is* using Access2000 with XP Pro on a fresh PC.
I just installed her PC again from scratch two weeks ago because she had a very destructive virus.
I installed Office2k and only a few other programs.

I know this question has been asked a *lot* but there are only a few answers given...
MS covers this message with kb Q283173 (problem with Access 97 and 2000);en-us;283173
But the regkey is NOT present on the client's PC.

Anybody has found a *real* solution for this ??
I really would like to *solve* this. (I know there are workarounds)

Arno R
Feb 21 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
On Feb 21, 5:20 am, "Arno R" <arraNOcomS...@tiscali.nlwrote:
Anybody has found a *real* solution for this ??
I really would like to *solve* this. (I know there are workarounds)
I offer these only because I think you may have advanced to the "try
anything" state.

1. Many years ago we (CDMA regulars) indentified that SendObject did
not work unless there is a (child) window visible in the Access
application window. That is, if we hide (not minimize) the database
window, and do not open any forms or reports, SendObject fails. But
the error message is not your error message. It's one in a hundred
that this might have something to do with you problem.

2. TTBOMK SendObject and all "sends" from Access depends upon MAPI and
its proper configuration. This code relies on mapi to open a draft
message in the default MAPI handler. I'm not suggesting this as a
workaround but it might be useful as a diagnostic. Perhaps you could
use it to ascertain that MAPI is OK on the client's computer, and what
the default handler for eml files is. This one's one in a thousand!

Private Declare Function ShellExecute& Lib "shell32.dll" _
Alias "ShellExecuteA" _
( _
ByVal Window&, _
ByVal Operation$, _
ByVal File$, _
ByVal Parameters$, _
ByVal Directory$, _
ByVal Show&)

Public Sub Draft( _
ByVal from$, _
ByVal recipients$, _
ByVal subject$, _
ByVal body$, _
Optional ByVal cc$, _
Optional ByVal bcc$, _
Optional ByVal priority&)

Dim buffer$
Dim filenumber%
Dim filename$
Dim path$

On Error GoTo DraftErr:

buffer = "From:" & Chr(34) & from & Chr(34)
buffer = buffer & vbNewLine & "To:" & Chr(34) & recipients & Chr(34)
If Len(cc) 0 Then _
buffer = buffer & vbNewLine & "CC:" & Chr(34) & cc & Chr(34)
If Len(bcc) 0 Then _
buffer = buffer & vbNewLine & "BCC:" & Chr(34) & bcc & Chr(34)
buffer = buffer & vbNewLine & "Subject:" & Chr(34) & subject & Chr(34)
If priority < 1 Or priority 3 Then _
priority = 3
buffer = buffer & vbNewLine & "X_priority:" & priority
buffer = buffer & vbNewLine & "X_Unsent: 1"
buffer = buffer & vbNewLine
buffer = buffer & vbNewLine & body

path = Environ("temp")
filename = path & "\temp.eml"
' I doubt this line is necessary
' in VBA but it may be
' in languages where "\"
' is a literal precursor
filename = Replace(filename, "\", "/")

On Error Resume Next
Kill filename
On Error GoTo DraftErr:

filenumber = FreeFile()
Open filename For Binary As #filenumber
Put #filenumber, , buffer
Close #filenumber

ShellExecute 0, "Open", "file://" & filename, "", "", 0

Exit Sub

With Err
MsgBox "Error Number " & .Number & vbNewLine & .Description, _
vbCritical, "Draft Creation Failed"
End With
Resume DraftExit
End Sub

Sub testDraft()
Draft "so*****", "so*****", _
"Draft", "This is a test."
End Sub

Feb 21 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.