Please set a message error

3 replies·opened Jan 23, 2017
B
borjapintor88Jan 23, 2017

Hi my websits is http://bachfestivalcanarias.com/concurso.html wen i try to sen a form it says "please set a message". Can you see what is going wrong? I recieve the messages.

Also i need to attach mora than on file. How can i do that?

Thanks !!!

S
SemiColonWebSTAFFJan 27, 2017

Hello,

  1. The following code is missing from your Page which displays the Notifications:
<div class="contact-form-result"></div>
  1. Please find the following code in the include/sendemail.php File:
if ( isset( $_FILES['template-contactform-file'] ) && $_FILES['template-contactform-file']['error'] == UPLOAD_ERR_OK ) {
	$mail->IsHTML(true);
	$mail->AddAttachment( $_FILES['template-contactform-file']['tmp_name'], $_FILES['template-contactform-file']['name'] );
}

and replace it with:

if ( isset( $_FILES['template-contactform-file'] ) ) {
	$mail->IsHTML(true);
	//Attach multiple files one by one
	for ($ct = 0; $ct < count($_FILES['template-contactform-file']['tmp_name']); $ct++) {
		$uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['template-contactform-file']['name'][$ct]));
		$filename = $_FILES['template-contactform-file']['name'][$ct];
		if (move_uploaded_file($_FILES['template-contactform-file']['tmp_name'][$ct], $uploadfile)) {
			$mail->addAttachment($uploadfile, $filename);
		}
	}
}

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

B
borjapintor88Jan 30, 2017

Thanks, now i dont see the "please set the message" but, i can not send more than one file.

Thanks

S
SemiColonWebSTAFFFeb 1, 2017

Hello,

We Really Apologize about the Inconveniences caused! Please check out the Official PHPMailer Example: https://github.com/PHPMailer/PHPMailer/blob/master/examples/send_multiple_file_upload.phps that has the Code for Multiple File Uploads.

Please consider modifying the Code provided according to your needs and it should definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard