Skip to content

Commit

Permalink
function sendTelegram added
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNadeev committed Mar 27, 2024
1 parent e525bdf commit 95ae70d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions sender.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@



// $to = "[email protected]";
// $subject = "Сочисто - новая заявка на форме";
$to = "[email protected]";
$subject = "Сочисто - новая заявка на форме";


// $headers = "From: [email protected]\r\n";
// // $headers .= "Reply-To: [email protected]\r\n";
// $headers .= "CC: [email protected]\r\n";
// $headers .= "BCC: [email protected]\r\n";
// $headers .= "Content-Type: text/plain; charset=utf-8\r\n";
$headers = "From: [email protected]\r\n";
// $headers .= "Reply-To: [email protected]\r\n";
$headers .= "CC: [email protected]\r\n";
$headers .= "BCC: [email protected]\r\n";
$headers .= "Content-Type: text/plain; charset=utf-8\r\n";

// $mail_result = mail($to, $subject, $message, $headers);
$mail_result = mail($to, $subject, $message, $headers);

// if ($mail_result) {
// echo "Email успешно отправлен 📧";
// } else {
// echo "Что-то пошло не так при отправке письма 🙁";
// }
if ($mail_result) {
echo "Email успешно отправлен 📧";
} else {
echo "Что-то пошло не так при отправке письма 🙁";
}

$conststxt = file_get_contents('consts.txt');
$consts = explode("\n", $conststxt);
Expand All @@ -56,6 +56,7 @@ function sendTelegram($chat_id, $message, $apiToken) {
$response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?".http_build_query($data));
};

sendTelegram($owner, $message, $apiToken);
sendTelegram($dev, $message, $apiToken);

?>

0 comments on commit 95ae70d

Please sign in to comment.