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:

Form Questions /

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

Testing email contact forms from local server

Go to End

2 Posts   303 Views


Community Member, 3 Posts

5 April 2017 at 9:56am

Edited: 05/04/2017 9:58am

Hi there,

I am building a contact form which sends an email upon submission using a combination of approaches provided in SilverStripe documentation (Introduction to frontend forms, and Simple contact form).

The code (included below) seems to be working fine, however I am wondering if it is possible to send test emails from a local server (in my case, MAMP) to properly test the functionality.

Many thanks in advance,

public function ContactForm() {
			$form = Form::create(
					FormAction::create('submit', 'Send Message')


			return $form;

		public function submit($data, $form){
			$email = new Email();

			$email->setSubject("Contact Message from {$data["Name"]}");

			$messageBody = "
				<p><strong>Name:</strong> {$data['Name']}</p>
				<p><strong>Message:</strong> {$data['Message']}</p>

			$form->sessionMessage("Thanks for your message, I'll get back to you as soon as I can",'good');

			return $this->redirectBack();


Community Member, 3 Posts

8 April 2017 at 3:06pm

Edited: 08/04/2017 3:08pm

As per have updated the sendmail fields in the php.ini files in MAMP (both in MAMP/bin/php/php5.6.10/conf and MAMP/conf/php5.6.10) to:

 ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =/usr/sbin/sendmail -t -i -f 

As per, have updated the mysite/_config/config.yml to include:

  send_all_emails_to: '' 

All to no avail...does anyone have any suggestions how this might be resolved?