21493 Posts in 5784 Topics by 2622 members
| Go to End | ||
| Author | Topic: | 1761 Views |
-
Re: Defining email attachement as a variable

19 September 2009 at 3:02pm
A repeat on an earlier issue, changing to
$fn = DataObject::get_by_id("MonkeysFist", 7);
$filepath = "assets/Uploads/mf_attachments/$fn->MFFileName";
$emailToSubmiter->attachFile($filepath, $fn->MFFileName);Fixes it
-
Re: Defining email attachement as a variable

19 September 2009 at 3:37pm
Bizarre stuff, indeed. If any other attachments get cheeky you may want to get a little more hands on and ensure the encoding, contents, and mime type are specified. With certain finicky MUAs out there, sometimes you must apply some thorough beatings until they yield.
An example from the codes:
$email = new Email();
$email->attachments[] = array(
'filename' => BASE_PATH . "/themes/mytheme/images/header.gif",
'contents' => file_get_contents(BASE_PATH . "/themes/mytheme/images/header.gif"),
'mimetype' => 'image/gif',
'contentLocation' => Director::absoluteBaseURL() . "/themes/mytheme/images/header.gif"
);
| 1761 Views | ||
| Go to Top |

