PHP mail() with large attachment not sent
-
03-07-2021 - |
سؤال
I'm implementing an email forwarder PHP program. Here is my requirement:
- Read the inbox of the particular email account with regular interval
- Incoming mails may have attachment or may not have attachment.
- Attachment may have large size.
- Forward the incoming mails to a destination with the attachment as they are in the original mail, but some mail body texts wil be removed.
I almost succeed. Mails with small file attachments were forwarded to the destination, but the problem is with the large file attachments (zip file about 23MB I tried).
It seems to me mail sending was successful because I did not see any error generated from the mail() function, but I did not receive it in my destination.
What's wrong with the mail() function ? Or should I use imap_mail() in place?
المحلول
As you are using php on commandline, I suppose, the only php limit I can thin of, is the memory-limit. But most likely this is not a php problem, but you run into the limits of your MTA. Squirrelmail has some information about MTA limits (section "Sending the mail with the attachment").