전자 메일을 보내는 많은 템플릿이 있습니다! 그래서 finish.php와 같은 다른 파일에서 file_get_contents 및 일부 매개 변수 (어떤 템플릿을 사용해야하는지 결정)로 "호출"하고자하는 php 파일 (send.php라고 부름)을 만들었습니다!file_get_contents plus file_exists (호출 된 파일 내부)
서로 다른 경로 :
- 템플릿 ("/ phpmailer/템플릿 /")
- send.php ("/phpmailer/send.php")
- finish.php ("/ 과정
: /finish.php ")는http://www.myadress.at/phpmailer/send.php?template=booking&[email protected]&name=Christopher
는
실무 링크 자체는 다음과 같이 보입니다
send.php 안에 템플릿이 존재하는지 확인하고, 그렇다면 메일이 전송됩니다! 지금 가입 양식을 작성 후, 나는 파일에서 확인 이메일을 보낼 때 누군가 책 과정이나 뭐,
if (file_exists(dirname(__FILE__)."/templates/".$template.".php") AND isset($email)) {
$mail->msgHTML(file_get_contents('https://www.myadress.at/phpmailer/templates/'.$template.'.php?'.$parameter.''), dirname(__FILE__));
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
}
else
{
ERROR
}
는, 사람이 양식 후 착륙 (finish.php)
내 send.php 파일의 경로와 내 finish.php 파일 께서 그냥 file_get_contents : file_get_contents와 finish.php에서 사용하려고 할 때
는$sendmail= file_get_contents("https://www.myadress.at/phpmailer/send.php?template=booking-confirmation&email=".urlencode($email)."");
이제 문제는, 그 존재 나던 템플릿을 말한다있다 ... 파이어 폭스에 같은 링크를 복사하면 모든 것이 작동합니다 .. n 템플릿의 ame이 맞습니다!
나는 다음과 같은 일을 시도했다 :
(file_exists(dirname(__FILE__)."/templates/".$template.".php") - with dirname
(file_exists("/templates/".$template.".php") - the normal path
(file_exists("/phpmailer/templates/".$template.".php") - full path
(file_exists("http://www.myadress.at/phpmailer/templates/".$template.".php") - normal url
Pleaaase 나를 도와 ^^ 아마도이