PHP - Ayuda con plantilla template monster

   
Vista:

Ayuda con plantilla template monster

Publicado por alexander (2 intervenciones) el 24/07/2015 18:46:04
buenas tengo un problema me baje una plantilla de template monster muy buena pero estoy en la parte de activar el formulario de contacto y no eh logrado que me envié el correo me sale el mensaje de que fue enviado pero no me llega nada ami bandeja de correo le adjunto mi codigo eh probado mil cosas pero aun no eh logrado que me llegue el email.
este es mi MainHanlder.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
	$owner_email='darksihart19@gmail.com';
	//SMTP server settings	
	$host = 'ssl://smtp.gmail.com';
    $port = '465';//"587";
    $username = 'test@gmail.com';
    $password = 'test';
 
    $subject='A message from your site visitor ';
    $user_email='';
	$message_body='';
	$message_type='html';
 
	$max_file_size=50;//MB 
	$file_types='/(doc|docx|txt|pdf|zip|rar)$/';
	$error_text='something goes wrong';
	$error_text_filesize='File size must be less than';
	$error_text_filetype='Failed to upload file. This file type is not allowed. Accepted files types: doc, docx, txt, pdf, zip, rar.';
 
	$private_recaptcha_key='6LeZwukSAAAAACmqrbLmdpvdhC68NLB1c9EA5vzU'; //localhost
 
 
	$use_recaptcha=isset( $_POST["recaptcha_challenge_field"]) and isset($_POST["recaptcha_response_field"]);
	$use_smtp=($host=='ssl://smtp.gmail.com' or $username=='darksihart19@gmail.com' or $password=='20661378');
	$max_file_size*=1048576;
 
	if($owner_email=='' || $owner_email=='#' ){
		die('Attention, recipient e-mail is not set! Please define "owner_email" variable in the MailHanlder.php file.');
	}
 
	if(preg_match('/^(127\.|192\.168\.)/',$_SERVER['REMOTE_ADDR'])){
		die('Attention, contact form will not work locally! Please upload your template to a live hosting server.');
	}
 
	if($use_recaptcha){
		require_once('recaptchalib.php');
		$resp = recaptcha_check_answer ($private_recaptcha_key,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]);
		if (!$resp->is_valid){
			die ('wrong captcha');
		}
	}
 
	/*
	if(isset($_POST['name']) and $_POST['name'] != ''){$message_body .= '<p>Visitor: ' . $_POST['name'] . '</p>' . "\n" . '<br>' . "\n"; $subject.=$_POST['name'];}
	if(isset($_POST['email']) and $_POST['email'] != ''){$message_body .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n" . '<br>' . "\n"; $user_email=$_POST['email'];}
	if(isset($_POST['state']) and $_POST['state'] != ''){$message_body .= '<p>State: ' . $_POST['state'] . '</p>' . "\n" . '<br>' . "\n";}
	if(isset($_POST['phone']) and $_POST['phone'] != ''){$message_body .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n" . '<br>' . "\n";}	
	if(isset($_POST['fax']) and $_POST['fax'] != ''){$message_body .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n" . '<br>' . "\n";}
	if(isset($_POST['message']) and $_POST['message'] != ''){$message_body .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";}	
	if(isset($_POST['stripHTML']) and $_POST['stripHTML']=='true'){$message_body = strip_tags($message_body);$message_type='text';}
*/
try{
	include "libmail.php";
	$m= new Mail("utf-8");
	$m->From($user_email);
	$m->To($owner_email);
	$m->Subject($subject);
	$m->Body($message_body,$message_type);
	//$m->log_on(true);
 
	if(isset($_FILES['attachment'])){
		if($_FILES['attachment']['size']>$max_file_size){
			$error_text=$error_text_filesize . ' ' . $max_file_size . 'bytes';
			die($error_text);
		}else{
			if(preg_match($file_types,$_FILES['attachment']['name'])){
				$m->Attach($_FILES['attachment']['tmp_name'],$_FILES['attachment']['name'],'','attachment');
			}else{
				$error_text=$error_text_filetype;
				die($error_text);
			}
		}
	}
	if(!$use_smtp){
		$m->smtp_on( $host, $username, $password, $port);
	}
 
	if($m->Send()){
		die('success');
	}
 
}catch(Exception $mail){
	die($mail);
}
?>


y no eh podido lograr que me llegue algun consejo de que podria estar mal lo ejecute directo del dreamweaver y me sale esto:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
is_valid){ die ('wrong captcha'); } } /* if(isset($_POST['name']) and $_POST['name'] != ''){$message_body .= '
Visitor: ' . $_POST['name'] . '
' . "\n" . '
' . "\n"; $subject.=$_POST['name'];} if(isset($_POST['email']) and $_POST['email'] != ''){$message_body .= '
Email Address: ' . $_POST['email'] . '
' . "\n" . '
' . "\n"; $user_email=$_POST['email'];} if(isset($_POST['state']) and $_POST['state'] != ''){$message_body .= '
State: ' . $_POST['state'] . '
' . "\n" . '
' . "\n";} if(isset($_POST['phone']) and $_POST['phone'] != ''){$message_body .= '
Phone Number: ' . $_POST['phone'] . '
' . "\n" . '
' . "\n";} if(isset($_POST['message']) and $_POST['message'] != ''){$message_body .= '
Message: ' . $_POST['message'] . '
' . "\n";}	 if(isset($_POST['stripHTML']) and $_POST['stripHTML']=='true'){$message_body = strip_tags($message_body);$message_type='text';} */ try{ include "libmail.php"; $m= new Mail("utf-8"); $m->From($user_email); $m->To($owner_email); $m->Subject($subject); $m->Body($message_body,$message_type); //$m->log_on(true); if(isset($_FILES['attachment'])){ if($_FILES['attachment']['size']>$max_file_size){ $error_text=$error_text_filesize . ' ' . $max_file_size . 'bytes'; die($error_text);	 }else{ if(preg_match($file_types,$_FILES['attachment']['name'])){ $m->Attach($_FILES['attachment']['tmp_name'],$_FILES['attachment']['name'],'','attachment'); }else{ $error_text=$error_text_filetype; die($error_text);	 } }	 } if(!$use_smtp){ $m->smtp_on( $host, $username, $password, $port); } if($m->Send()){ die('success'); }	 }catch(Exception $mail){ die($mail); }	 ?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder