mojoblanco
mojoblanco

Reputation: 723

Maximum file size in email attachment PHP codeigniter

My application can send an email with an attachment successfully, but when the attachment exceeds 800KB the message doesn't get delivered. What could be the problem?

Upvotes: 0

Views: 1981

Answers (1)

Abdulla Nilam
Abdulla Nilam

Reputation: 38584

There is no limit for Email. If you want to send 50MB+ attachment you can. It will handle by your mail sender.

Don't use Codeigniter mail. Use some other third party Mail library's.


Some best Third party Library's which cooperate with codeigniter

  1. phpmailer
  2. swiftmailer

As well as about PHP.ini settings which you can test own

  1. memory_limit - PHP may require more memory to import large files then it has available. Increasing this value will give PHP more memory to use. 60mb has proven to be a good value for this variable if you want to handle attachments up to about 10mb.
  2. max_execution_time - The time PHP has to execute a script. If you're downloading large files from across the internet, you may need more time
  3. upload_max_filesize - The maximum size a file upload can be. This affects files staff try to upload to attach to emails.
  4. post_max_size - The maximum size an HTTP POST request can be, this can limit the maximum size a file can be when uploading files to attach to emails.
  5. upload_tmp_dir - The directory uploaded files are temporarily stored in during transmission. If no attachments of any size are able to be uploaded then this value may be unset or set to a directory which is not writable by the web server.

Upvotes: 2

Related Questions