如何在我们公司获得smtpclient? [英] How to get smtpclient in our company ?

查看:416
本文介绍了如何在我们公司获得smtpclient?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I WORK at ABC Company . and I was assigned to make an application to send an email to employees .
I try browsing and the following code :







public void Send(MailMessage msg)
        {
            SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
            client.EnableSsl = true;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            client.Credentials = new NetworkCredential(Username, Password);
            client.Send(msg);
        }







when I run, it does work well . but the email server that I would use is the domain of companies that Rudi_Bastian@abc.com
How do I get my company SmtpClient it ?

may be the master here can help me .





我尝试了什么:



i不知道我该怎么办,,,

请帮帮我。因为我的截止日期已经结束帮助我......



What I have tried:

i dont know what can i do,,,
please help me. because my deadline is closed. help me...

推荐答案

这不是一个编程问题,更像是系统管理员问题。首先不要使用gmail发送电子邮件



你做的事情不应该花时间做| ASP.NET论坛 [ ^ ]



你需要你的公司系统管理员告诉你哪些公司的smtp服务器可以用来发送电子邮件,使用什么端口(可能是25)以及你需要一个用户名\密码访问它(可能不是)。然后,您可以调整代码以匹配这些要求(例如,如果不需要,请删除凭证内容并更改smtp服务器和端口)。
This isn't really a programming question, more a system admin one. First off don't use gmail to send email

Things you shouldn't spend time doing | The ASP.NET Forums[^]

You need your company sys admin to tell you what company smtp server you can use to send emails through, what port to use (probably 25) and if you need a username\password to access it (probably not). You then adapt the code to match those requirements (eg drop the credential stuff if not needed and change the smtp server and port).


这篇关于如何在我们公司获得smtpclient?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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