Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Images uploaded from MultipleImageUploadField as e-mail attatchment

Go to End



Community Member, 18 Posts

21 February 2012 at 9:43am


I've got a simple form with MultipleImageUploadField for the frontend.

function Form(){
		$fields = new FieldSet(
			new TextareaField('About', htmlentities('Über dich')."<span class=\"require\">*</span>", 8),
			$images = new MultipleImageUploadField('Pics', 'Bilder (Bitte Name in der Datei angeben)', array (
				'sizeLimit' => '2097152',
				'buttonText' => 'Durchsuchen..',
				'queueSizeLimit' => '5',
				'auto' => false,
				'upload_on_submit' => true
		$actions = new FieldSet(
			new FormAction('doSubmitApplication','Bewerben')
		$validator = new RequiredFields(
		$form = new Form(
		return $form;

	function doSubmitApplication($data, $form){
		$application = new Application();

The uploaded images should be attatched to a mail. I send the mail in the Application class in the function onBeforeWrite(). In the function I use this function.

protected function sendEmail(){
		$body = "
		$from = Email::getAdminEmail();
		$email = new Email(

How can I get attatch the images from the Application class?