谢谢你帮我最后一个问题... [英] Thanks for helping me. One last question...

查看:133
本文介绍了谢谢你帮我最后一个问题...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生您好,

Hello sir,

protected void ButtonSubmit_Click(object sender, EventArgs e)
    {
        MailMessage mail = new MailMessage();
        

            mail.From = new MailAddress(TextBoxEmail.Text, TextBoxCompanyName.Text);
            mail.To.Add(new MailAddress("indra.rikkala@achirconsultancy.com"));
           
            mail.Subject = TextBoxSubject.Text;
            mail.Body = TextBoxMessage.Text;

        SmtpClient client
            = new SmtpClient("smtp.achirconsultancy.com");
        client.Credentials = new System.Net.NetworkCredential("indra.rikkala@achirconsultancy.com", "zzzzzzzz");
        try
        {
           
            client.Port = 25;
            client.Send(mail);
        }
        catch (Exception ex) 
        {
            Labeltext.Text = " Error occured. Sorry for the inconvinence";
            return;
            /*Response.Write(" Unhandled expection occured please check the Email ID that you have entered");*/

        }

        Labeltext.Text = "Your message has been successfully sent. Thank you";
               
    }



非常感谢您在无法在Asp.net中发送电子邮件"问题上为我提供帮助

我还有最后一个问题,能否请您对此主题进行澄清.


我的网站托管在Discountasp.net中.
好吧,此代码中的问题是端口号.
如果我将端口号从25更改为587,则可以正常工作.为什么会这样?
如果是25,则无法与服务器通信.


还有一件事是,仅当我提供相同域(我正在工作的域)的电子邮件(TO和FROM)时,它才起作用.我不能将邮件发送给域外的其他人吗?

关于此主题的很多文章都没有在网络凭据部分提及用户名和密码的详细信息.那是可选的吗??

在web.config文件的网络凭据"部分中,我必须提供哪些用户名密码详细信息?是该域的控制面板吗?还是仅从地址(电子邮件)用户名和密码?


很抱歉问了这么多问题,但是对这些问题的回答肯定会给我确切的信息.

感谢您分享您的智慧.



Thanks a lot for helping me on "unable to send email in Asp.net" question

I have one last question can you please give me clarification on this topic.


I hosted my site in Discountasp.net.
Well, the problem in this code is port number.
If I change my port number from 25 to 587 it''s working. Why so???
If it is 25 it is unable to communicate with the server.


And one more thing is it''s working only if I supply the emails(both TO and FROM) of same domain(the domain I am working for). Can''t I send mail to another person outside of my domain?

Lot of articles on this topic didn''t mention to give username and password details in network credential section. Is that optional????

At network credential section in web.config file which username password details I have to supply? Is it the control panel of that domain? or just from address(email) username and password?


Sorry to ask these many questions but answers to these questions certainly give me what exactly I am doing.

Thanks for sharing your wisdom.

推荐答案

问:如果我将端口号从25更改为587,它将起作用.为什么会这样?
如果是25,则无法与服务器通信.

答:默认情况下,SMTP服务器端口为25,但是可以更改,您的SMTP服务器配置为587,这意味着它正在PORT 587上列出,并且如果要与SMTP通信,则只能使用PORT 587. br/>

问:还有一件事是,仅当我提供相同域(我正在工作的域)的电子邮件(TO和FROM)时,它才起作用.我不能将邮件发送给域外的其他人吗?

答:是的,如果不受管理员限制,则可以.

问:在web.config文件的网络凭据"部分中,我必须提供哪些用户名密码详细信息?是该域的控制面板吗?还是仅从地址(电子邮件)用户名和密码?

答:可以访问SMTP服务器的网络凭据.询问您的管理员.
Q: If I change my port number from 25 to 587 it''s working. Why so???
If it is 25 it is unable to communicate with the server.

A: By default the SMTP server port is 25 but that can be changed, your SMTP server is configured at 587, it means it is listning on PORT 587, and if you want to communicate with your SMTP you should use PORT 587 only.


Q: And one more thing is it''s working only if I supply the emails(both TO and FROM) of same domain(the domain I am working for). Can''t I send mail to another person outside of my domain?

A: Yes you can, if it is not restricted by your administrator.

Q: At network credential section in web.config file which username password details I have to supply? Is it the control panel of that domain? or just from address(email) username and password?

A: Network credential to which your SMTP server is accessible. Ask your administrator.


这篇关于谢谢你帮我最后一个问题...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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