尝试发送邮件...它显示错误,如该做什么 [英] try to send mail... it shows error like that what to do

查看:99
本文介绍了尝试发送邮件...它显示错误,如该做什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class sms : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    public void send(string uid, string password, string message, string no)
    {
        HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("http://ubaid.tk/sms/sms.aspx?uid=" + uid + "&pwd=" + password + "&msg=" + message + "&phone=" + no + "&provider=fullonsms");
         
        HttpWebResponse myResp = (HttpWebResponse)myReq.GetResponse();
        System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
        string responseString = respStreamReader.ReadToEnd();
        respStreamReader.Close();
        myResp.Close();
    }

    protected void btnSendSms_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            string yourmobilenumber = "yourmoblienumber";
            string yourpassword = "yourpassword";
            send(yourmobilenumber, yourpassword, txtMessageBody.Text, txtRecipient.Text);           
        }
    }
}



显示403错误







添加标签。

[/编辑]

推荐答案

您正在发送短信而不是电子邮件



参考 - HTTP 403 [ ^ ]。

You are sending sms not Email.

Refer - HTTP 403[^].
引用:

A Web服务器可能会返回 403 Forbidden HTTP状态代码,以响应客户端对网页或资源的请求,以指示可以访问服务器并理解该请求,但拒绝采取任何进一步的操作。状态代码403响应是Web服务器被配置为拒绝由于某种原因由客户端访问所请求的资源的结果。

A web server may return a 403 Forbidden HTTP status code in response to a request from a client for a web page or resource to indicate that the server can be reached and understood the request, but refuses to take any further action. Status code 403 responses are the result of the web server being configured to deny access, for some reason, to the requested resource by the client.

因此,您请求拒绝回复的服务器。 br $>


请联系 ubaid sms 提供商的支持团队。

So, the Server you are requesting to refuses to reply.

Please contact the support team of ubaid sms provider.


这篇关于尝试发送邮件...它显示错误,如该做什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆