私はphpを初めて使用するので、ご容赦ください。作成しているテストWebサイトの登録を作成しました。Webサイトはユーザー情報を収集し、確認メールを送信します。これまでのところ、何度か試行してもメールは届いていません。スパムフォルダを試しましたが、役に立ちませんでした。
これが私のコードです:
$to = "$email";
// Change this to your site admin email
$from = "someperson@gmail.com";
$subject = "Complete your registration";
//Begin HTML Email Message where you need to change the activation URL inside
$message = '<html>
<body bgcolor="#FFFFFF">
Hi ' . $username . ',
<br /><br />
You must complete this step to activate your account with us.
<br /><br />
Please click here to activate now >>
<a href="http://testw.freevar.com/activation.php?id=' . $id . '">
ACTIVATE NOW</a>
<br /><br />
Your Login Data is as follows:
<br /><br />
E-mail Address: ' . $email . ' <br />
Password: ' . $password . '
<br /><br />
Thanks!
</body>
</html>';
// end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$to = "$to";
// Finally send the activation email to the member
mail($to, $subject, $message, $headers,-f $from);
前もって感謝します!
PS私はphp.iniフォルダについてオンラインで読みました。私はゼロからウェブサイトを作成していますが、これが何であるか、または必要かどうかわかりません。また、メールアドレスのない無料のホスティングサービスを利用しています。これが影響するかどうかはわかりません。