Last active
November 7, 2019 14:20
-
-
Save IgorMiroshin/3feaaee2d0e550fb4b86b67ca33dc46f to your computer and use it in GitHub Desktop.
Sendmail in Telegram using curl request + SOCKS5 protocol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_POST['phone']) && !empty($_POST['phone'])) { | |
$phone = strip_tags($_POST['phone']); | |
$phoneFieldset = "Phone: "; | |
} | |
if (isset($_POST['message']) && !empty($_POST['message'])) { | |
$message = strip_tags($_POST['message']); | |
$messageFieldset = "Message: "; | |
} | |
$token = "token"; | |
$chat_id = "chat_id"; | |
$arr = array( | |
$phoneFieldset => $phone, | |
$messageFieldset => $message | |
); | |
foreach ($arr as $key => $value) { | |
$txt .= "<b>" . $key . "</b> " . $value . "%0A"; | |
}; | |
$url = "https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}"; | |
$proxy = "127.0.0.1:8080"; // ip:port, SOCKS5 servers http://spys.one/socks/ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_PROXY, $proxy); | |
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 1); | |
$curl_scraped_page = curl_exec($ch); | |
curl_close($ch); | |
?> |
89114991090 Позвоните, есть работа для вас.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Как получить token и chat_id для бота описано в данной статье:
https://smartlanding.biz/otpravka-dannyx-formy-v-telegram.html
How to get the token and chat_id for the bot described in this article:
https://smartlanding.biz/otpravka-dannyx-formy-v-telegram.html