2012-05-03 4 views
0

.. 당신 자신을 위해 할 것처럼연락처 양식을 만드는 방법 사용자에게 확인 이메일을 보내시겠습니까? 이것은 내가 지금까지 무엇을 가지고

$full_name = $_REQUEST['full_name'] ;   
$company = $_REQUEST['company'] ;  
$abn = $_REQUEST['abn'] ;  
$customer_number = $_REQUEST['customer_number'] ;  
$about = $_REQUEST['about'] ;  
$areacode = $_REQUEST['areacode'] ;  
$telephone = $_REQUEST['telephone'] ;   
$email = $_REQUEST['email'] ;  
$message = $_REQUEST['message'] ;  
$body =" Full Name: ".$full_name."\n 

Company: ".$company."\n     
ABN: ".$abn."\n  
Customer Number: ".$customer_number."\n 
About: ".$about."\n  
Area Code: ".$areacode."\n  
Telephone: ".$telephone."\n  
Email: ".$email."\n      
Message: ".$message; 

$to = "$email"; 

mail("[email protected]", "Contact Us Form", $body, "From: $email"); 
+1

그리고 이것은 작동하지 않습니다 ... 어떻게? –

+1

이메일을 보내는 것처럼 이메일을 보내십시오. –

+0

이것을 실행 했습니까? PHP에서 오류가 발생 했습니까? – deex

답변

0

.

mail($email, "Thanks For Resistering", $a_thank_you_message, "From: [email protected]"); 
+0

아쉽게 고맙습니다. –

0

데이터베이스에 테이블을 만듭니다. 그것은해야 필드가 포함되어

  • ID (자동 증가)
  • 이메일을
  • 메시지
  • 확인 사용자 게시물 양식 대신 이메일로 메일을 전송하지 않습니다

그 중 임의의 확인 코드 (예 : uniqid 사용)를 만들어야합니다.

$confirmation = uniqid(); 

그런 다음 테이블에 사용자 이메일, 메시지 텍스트 및 확인 코드를 추가하고 사용자에게 이메일을 보내 :

$url = "http://".$_POST["SERVER_NAME"]. 
    "/confirmation.php?confirmation=$confirmation'>"; 
mail($email, "Confirmation", 
"Please press the following link to confirm your message: 
<a href='http://$url'>confirm</a>."); 

confirmation.php에서 파일 사용 $_GET["confirmation"] 변수 표에 기록을 일치 검색, 그것에서 이메일과 메시지를 얻을 이 데이터를 이메일로 보내십시오. 원한다면 데이터베이스에서 항목을 제거 할 수 있습니다.

관련 문제