私はphpのスクリプトに取り組んでいます。私は特定のアドレスにメールを送りたいと思います。フォームを提出することなくPHPで電子メールを送信するには?
<?php
$to = "[email protected], [email protected]";
$subject = "HTML email";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body>
<p>This email contains HTML Tags!</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>John</td>
<td>Doe</td>
</tr>
</table>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// More headers
$headers .= 'From: <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
mail($to,$subject,$message,$headers);
?>
ですので、誰でも私に電子メールアドレスを送信する方法を教えてください。
クリックしないでも手段を提出しないで? – Jalpa
CRONJOBが必要 –
ページリフレッシュまたはcronファイルにコードを追加する。 – Jalpa