Android Question attach big file (10MB) in mail

fanfalveto

Active Member
Licensed User
Longtime User
I'm trying to send by mail a file of 10MB,first compress the folder (this does well and creates the zip file correctly), with small files no problem but this does not work but with a big file don´t work.
I try with SMTP llibrary and SMTPExtras
this is the code, thanks
B4X:
Dim smm As SMTPExtras

smm.Initialize("smtp.gmail.com","[email protected]","yyy","smtpp")
smm.UseSSL=True
smm.To.Add("[email protected]")

smm.Subject="Imagenes"
smm.Body="imagenes"
Arc.ZipFolder(File.DirRootExternal&"/images",File.DirRootExternal,"images.zip","comprimir")
smm.AddAttachment(File.DirRootExternal,"images.zip")
smm.Send
 

JakeBullet70

Well-Known Member
Licensed User
Longtime User
I know gmail has a 10gig file limit when using google drive.
Gmail's normal limit is 25MB

Also I have see problems with ZIP files. I am thinking that gmail de-compresses them to scan for viruses.
Maybe try renaming it to something else from a zip file?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
With gmail you can send mails of up to 25mb in size. Please note that 10mb attachment creates a 13.5mb mail... so the maximum size should be approx 17mb or so...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Have you checked the logs for any errors (check the unfiltered logs as well)?

The SMTP object loads the entire file to memory and the converts it to base64 string (mail attachments are sent as strings). This means that a 10mb file will require 10 + 10 * 1.3 mb of available memory. After the file is written to the stream the memory is released.
 
Upvote 0

fanfalveto

Active Member
Licensed User
Longtime User
The .zip is created ok,the problem is if .zip file size>3,6Mb can´t attach this file.
May be is memory problem.
Thank you :)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The .zip is created ok,the problem is if .zip file size>3,6Mb can´t attach this file.
May be is memory problem.
Thank you :)

I would like to suggest considering using google drive or dropbox... Upload file to drive or dropbox and then share a link to this file via mail.
 
Upvote 0
Top