roger
10-01-2001, 10:15 AM
Hi Guys,
I'd like to find out the size of the mailbox, and the personal Folder size. I'm using CDO 1.21
I couldn't connect to either one of them.
Any help would be greatly appreciated.
Thanks
Roger
"Great Ideas need Landing Gears as well as Wings"
ChiefRedBull
10-01-2001, 10:40 AM
I'm a little confused Rog,
could you give us a bit more info? "the mailbox"? Which mailbox? your mailbox? How are you trying to connect?
Chief
"How are we to learn, if those that know will not teach... ?" - Me.
roger
10-01-2001, 12:20 PM
Hi, Sorry if I wasn't clear, here is more information.
I'm using the below code to connect MAPI session.
Set objSession = CreateObject("MAPI.session")
objSession.Logon ProfileName:=profilenamestr, _
profilePassword:=pwdDecrypted, _
ShowDialog:=True
If objSession Is Nothing Then
MsgBox "objSession = nothing"
End If
After I connect to the MAPI Session, I need to check the size of the mailbox, I'm developing an application that sends emails to clients with excel attachements. But I noticed that if I attempt to send emails when the mailbox size is too big, I receive a MAPI Error, couldn't send email.
I thought if I can check the mailbox size before I send any email, it would make it easier.
I hope that I clarified the situation,
Thanks for your help,
Roger
"Great Ideas need Landing Gears as well as Wings"
ChiefRedBull
10-01-2001, 01:30 PM
Correct me if I'm wrong, but isn't the
<font color=red>:=</font color=red>
syntax used in Pascal?? Does it even compile in VB?
As to checking the size of the inbox - i don't think thats the problem. Most inbox's have a maximum limit. If you're sending to Hotmail its something like 1MB, if you're sending to Outlook its different. The mail is stored on a microsoft server, then downloaded by the user. I think you can send up to about 1MB as well....
You might have to split the file into smaller bits, then send several emails.....
Chief
"How are we to learn, if those that know will not teach... ?" - Me.
roger
10-01-2001, 01:56 PM
Hey, Chief
Thanks for replying to my post again :)
It is VB code, it complies and runs fine so far.
You see, email app used is outlook on Microsoft exchange. When the user sends the emails to the clients, if the user's mailbox is near full or full, the application can't send any emails. My question is pertaining to the mailbox of the sender not the receiver.
Thanks for your help again.
Roger
"Great Ideas need Landing Gears as well as Wings"
ChiefRedBull
10-01-2001, 02:45 PM
Hmm...... So if the box is full you can't send a mail, not even a small one.
Interesting....
If I were you I'd add the <font color=red>On Error</font color=red> to your MAPI sub.
Like this:
<pre><font color=red>Public Sub SendMail() ' or whatever
On Error GoTo MAPI_Err
'
' mapi code here
'
Exit Sub ' important - so the MAPI_Err block isn't run
' this block is only run in the case of an error
MAPI_Err:
MsgBox "Error sending mail - " & Error
Exit Sub
End Sub
</pre></font color=red>
If you knew how to implement basic error checking, sorry for patronising.. images/icons/wink.gif. If not - This is how I would do it.
Chief
"How are we to learn, if those that know will not teach... ?" - Me.