Skip to content

Email Attachment Name

Derek Jones edited this page Jul 5, 2012 · 3 revisions

Category:Help:TipsAndTricks

I have a suggestion for the email attachments.

I had a requirement that users could send attachments from web forms and those were forwarded to an email account.

There was no need to keep the file on the temp directory or use the fileuploader class.

So, I added a parameter to the Email->attach($filename) method.

add after line 71 -> var $_attach_name_email = array(); add after line 158 -> $this->_attach_name_email = array(); replace the method signature from -> function attach($filename, $disposition = 'attachment') to -> function attach($filename, $filenameEmail, $disposition = 'attachment')

remove line 1112 -> $basename = basename($filename); add after line 1111 -> if(isset($this->_attach_name_email[$i])) { $basename = $this->_attach_name_email[$i]; } else { $basename = basename($filename); }

Please let me know if there are more changes to do.

Clone this wiki locally