Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I am trying to Send mail through mapi wih any no of attachments.

lReturn = MAPISendMail(0, 0, mapi_Message, mapi_Recipient, mapi_File, MAPI_DIALOG, 0)

MAPISendMail return SUCCESS if no of attachments less or equal to 4

otherwise it is returning failure

XML
<pre lang="vb">With mapi_Message

         .Subject = &quot;Packed File&quot;
         .NoteText = sMailMsg
         .Flags = 0
         .FileCount = kCount + 1
         .RecipCount = 0
         .Reserved = 0
         .DateReceived = &quot;&quot;
         .MessageType = &quot;&quot;
     End With</pre>


For iCount = 0 To UBound(Attch)
<pre lang="vb">With mapi_File(jCount)
    .Filename = sTempFileName
    .PathName = sTempFileName
    .Position = iCount 
    .FileType = &quot;&quot;
    .Reserved = 0
End With</pre>

next
Posted
Updated 22-Aug-13 2:25am
v2
Comments
Joezer BH 22-Aug-13 8:37am    
Maybe it's not a number of attachments, but size limit?
Did you check with one large attachments and with many small ones?
Yogesh_Dixit 23-Aug-13 9:44am    
Yes it is allowing to attach single file whose size is 20mb
Dave Kreskowiak 22-Aug-13 12:17pm    
Without knowning what the error message was, anything anyone tells you is just guessing.

But, the most common problem is that your total size of attachments exceeds the limit specified by your SMTP server, usually 10MB. Oh, and that size limit is the Base64 encoded size of your attachments, NOT the "size on disk" of them.
Yogesh_Dixit 23-Aug-13 9:46am    
10 mb size limit is correct but if iam attaching 4 files of total size less than 10 mb it was successfully attached
Dave Kreskowiak 23-Aug-13 12:47pm    
Then you need to get with the owner of the mail server you're using and see if the limit can be increased for the user that your coding is using to send mail.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900