开发者

PHP: mail attachment file size

Ok, the scenario is this. I have a php code that sends out email with excel file attached to it. I have two different servers with me. The first one, ive blasted out an excel file with 100+kb and its good. I tried it out with the second server, same file. But it failed. I tried to minimize the file size to 10kb, and lucky, the file got sent. Now im a bit p开发者_JS百科uzzled how come the first server can send more than a 100kb attachment while the second server cant. Is there some thing i need to configure in the php.ini?


The maximum size is handled by the the email server.

There is no settings to change to your php.ini, if you don't get any warning about memory size limit or max execution time being reached.

Virtually PHP is able to send any emails even 100 MB(if your code doesn't use too much memory).

After you have to make sure the email server will accept it. I think most of the email server are configured to handle 10 MB email. You also have to keep in mind that file are going to be base64 encoded to be attached with email. Base64 encoding would make your file being 33% more heavy. So a 10MB files attached to an email actually generate a 13.3MB email.

I think the first thing to check would be the email server logs.


Is there anything in the PHP error logs or server's mail logs? I wouldn't expect PHP to run into problems with such a small file, so it might be a setting on your mail server. Have you checked your junk mail folder and that you typed the destination email address correctly too?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜