Message size limit with CDO?
I have an application in which I'm creating an email which I want the SMTP server (IIS) on the same box to deliver (OS is 2003 Server 32 bit). I send this using the "cdSendUsingPickup" method.
Using my IMessage interface, I copy the message to the servers pickup directory. All works great as long as my message is below ~150MB. The size is accounted for by attachments to the mail. But if I include attachments over this limit, IMessage::GetStream() fails with 0x8007000e - not enough storage space is available to complete this operation. The server has plenty of HD space. I'm running into a some kind of space limitation and I'm thinking it's more a memory limitation, not a HD space issue but I'm finding no clues as to what's going on. Pseudo code below - the call to GetStream fails with a message bigger than 150MB or so.开发者_C百科 Works fine with smaller messages.
DlvrMsg(IMessage piMsg)
{
_StreamPtr pStream = NULL;
HRESULT hr = piMsg->GetStream(&pStream);
pStream->put_type(adTypeBinary);
//.. then use pStream->Read() to read the bytes of the message
// and copy to an .eml file in the pickup directory.
...
}
Yes apparently there is a limit, though MS won't give hard and fast rules for what that limit is. They only say the call to GetStream() fails in a call to realloc. More and more memory is reallocated until it hits some artificial limit.
This occurs in 2003 server as well as 2008 both 32 and 64 bit. Only work arounds are to use something other than CDO to send your mail.
精彩评论