양식이 있습니다. 나는 등록한 여러 사람들에게 이메일을 보내고 보내는 "게시"방법을 사용하고 있습니다. 그런 다음 이메일의 $ body는 템플릿을 기반으로합니다. 데이터베이스 없음, 클래스 없음, 단순한 형식. 예, 이것에 관해서는 이미 읽었습니다. 모두 거기에 있습니다. 나는이 사건과 관련하여 그것을 모을 수 없었습니다. 텍스트 파일에서 내용 가져 오기 및 키워드 바꾸기 PHP
"email_template.txt는"같은 것을해야한다 텍스트 :<?php
//form and validation
$firstname = "John"; // inputed name on the form, let say
$lastname = "Doe"; // inputed last name
$email = "example"; // inputed email
//email message
$body = ... some type of a get_file_content....
mail($_POST['email'], 'Party Invitation', $body, 'From: [email protected]');
?>
:
Hello #firstname# #lastname#. Thank you for registering! Your registered email is #email#
내 PHP에 PHP
Hello **John Doe**. Thank you registering! Your registered email is **[email protected]**.
에 의해 처리에 다음과 같이겠습니까을 내가 좋아하는 뭔가를
$ body는이 PHP 양식을 통해 제출 된 등록자에게 보내는 전자 메일 메시지입니다.
어떻게 든 작동하지 않습니다 .... $ body = file_get_contents (email_template.txt); $ body = str_replace ("# firstname #", $ firstname, $ body); $ body = str_replace ("# lastname #", $ lastname, $ body); $ body = str_replace ("# email #", $ email, $ body); – mythoslife
신경 쓰지 마세요. – mythoslife
ok 따옴표를 찾았습니다. :) – surivitna