php nette give error when someone submit form. the error are below

  nette, php

Fatal error: Uncaught NetteMailSendException: Unable to send email.

if ($form->isSubmitted()) {
  $values = $form->getValues();

  $mail = new NetteMailMessage;
  $mail->setFrom('[email protected]')
          ->addTo('[email protected]')
          ->setSubject('New contact')
          ->setHtmlBody('Hi<br> you've got new message.<br> from: ' . $values['name'] . '<br> email: ' . $values['email'] . '<br> Message:' . $values['message']);

  $mailer = new NetteMailSendmailMailer();
  $mailer->send($mail);

Source: Ask PHP

LEAVE A COMMENT