Copy codeThe Code is as follows:
# Region's free sending interface (valid for testing at a.m. on February 6)
/// <Summary>
/// Send the flying staff interface for free (you must activate the flying mail to add the recipient as a friend before sending it, or you can send it to yourself for testing)
/// </Summary>
/// <Param name = "sendNumber"> log on to the Apsara mobile phone number </param>
/// <Param name = "sendPassword"> logon password </param>
/// <Param name = "receiveNumber"> receive mobile phone number </param>
/// <Param name = "Content"> text message Content </param>
/// <Returns> </returns>
Public bool sendfetion (string sendNumber, string sendPassword, string receiveNumber, string Content)
{
String url = string. Format ("https://quanapi.sinaapp.com/fetion.php? U = {0} & p = {1} & to = {2} & m = {3} ", sendNumber, sendPassword, receiveNumber, HttpUtility. UrlEncode (Content ));
String strRet = "";
Try
{
HttpWebRequest hr = (HttpWebRequest) WebRequest. Create (url );
Hr. UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1 )";
Hr. Method = "GET ";
Hr. Timeout = 30*60*1000;
WebResponse hs = hr. GetResponse ();
Stream sr = hs. GetResponseStream ();
StreamReader ser = new StreamReader (sr, Encoding. Default );
StrRet = ser. ReadToEnd ();
}
Catch (Exception er)
{
StrRet = "";
}
If (! StrRet. contains (": 0") return false; // The returned data is: {"result": 0, "message": "\ u53d1 \ u9001 \ u6210 \ u529f "}
Return true;
}
# Endregion
The interface is built on SinaAppEngine, And the SAE service is relatively reliable.
The sender user and password should not be written incorrectly. Then, the recipient must be himself or a friend of the flying mail to successfully send the message.