PHP send email with attachments


How can you send Email with attachment using php?In this post will describes how to send email with attachments using php.You can download source code and can be view demo.PHPMailer package can be use to this purpose easily.

You can Download PHPMailer from here.

Note: If you run this localhost/wamp/wampp you must check/change the following extensions are enabled or not.

  • php_openssl” Extension
  • upload_max_filesize“, “max_execution_time” and “memory_limit” in the php.ini file.
  • file_uploads” states is “on”
  • smtp_port” is 25.You can change this passing proper value.

This is the form.

This is the php script to handle the mail process.


} // end else


That’s only.

View Demo

Download PHP send email with attachments Example (60 KB)


About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.