Support the ongoing development of Laravel.io →
posted 8 years ago
Mail

Hello,

i work for the first time with Laravel.

In the tutorial I am now arrived in the mail delivery.

Unfortunately, the placeholder for the message will not be replaced .

This is the Template:

Hallo lieber Interessent,
 
vielen Dank für Ihre E-Mail an uns. Wir werden diese so schnell wir möglich beantworten.
 

Das war Ihre Nachricht:
    
{{ $data['message'] }} 

Ihre Email:
{{ $data['email'] }}
 

 
Mit freundlichen Grüßen,
Ihr Laravel Anfänger Tutorial Team

And the PageController:

public function sendkontakt()
	{
		$rules = array(
			'email'     => 'Required|Between:3,64|Email',
			'message'   => 'Required'
		);
		
		
		$validator = \Validator::make(array(\Input::all()), $rules);
		if(true) {//$validator->passes()
			
			\Mail::send('email.kontaktdefault', \Input::all(), 
			function($message)
			{
				
				$message->from('from@bla.de', 'Laravel Anfänger Tutorial');
				$message->to('to@bla.de', 'Dirk Helbert')->subject('Nur ein Test!');
				
			}
			);
			
			return \Redirect::action('PageController@kontakt')->with('sendsuccess',1);
		} else {
			
			
			return \Redirect::action('PageController@kontakt')->withInput()->withErrors($validator);
		}
		exit;
	}

Thx for your help. Robby

Last updated 3 years ago.
0
Solution

The view doesn't have the extension .blade.php. It works fine with blade.php

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

RobbyT robbyt Joined 17 Aug 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.