Sharan Mohandas
Sharan Mohandas

Reputation: 871

Maximum Attachment Size Mail Services

So I have made this php script (Using PHPMailer) that collects lead and send an automated mail with a PDF File as Attachment.

The Problem is the script works for small sized Files. But the client has provided me to send a PDF file of the size 24,139 KB.

So I Increased the memory_limit to 128M since memory was exhausted earlier (64M Earlier). The script now works fine without an error but I don't recieve any mail with this large file

Does mail providers such as Gmail,Yahoo etc blocks large attachments?? If so could someone tell me what is the maximum size, so that i could ask my client to limit the PDF size

Any Help?? Sharan

Upvotes: 3

Views: 7103

Answers (2)

Synchro
Synchro

Reputation: 37730

It can take quite a lot of memory to encode large files in memory, so increasing memory_limit is the right thing to do there.

The maximum message size an SMTP server will accept is often given in the response to the EHLO command. There is a ticket open for this in PHPMailer, but as yet it doesn't support it automatically.

Bear in mind that binary files need base64 encoding, which increases file size by about 1/3.

To see exactly why you are failing to deliver your message, set $mail->SMTPDebug = 3; and you will see the SMTP conversation. Failing that, check the ErrorInfo property after sending, or your local mail server logs if you are not sending via SMTP.

Upvotes: 4

BMC
BMC

Reputation: 166

Yahoo: You can send and receive emails up to 25MB in size with Yahoo Mail. [1]

Gmail: Attachment size limit. You can send messages up to 25 megabytes (MB) in size. [2]

Hotmail/Outlook: 10 MB [3]

Gmail includes full message size.

[1] https://help.yahoo.com/kb/message-size-limit-sln5673.html
[2] https://support.google.com/mail/answer/6584?hl=en
[3] http://answers.microsoft.com/en-us/windowslive/forum/email/what-is-hotmails-attachment-size-limit/feeed45f-bdab-47fc-a206-509aa2e9175d

Upvotes: 1

Related Questions