如何查找SMTP主机名? [英] how to find the SMTP host name?

查看:1224
本文介绍了如何查找SMTP主机名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...

i有一个发送邮件给邮件的代码......

但是我知道如何给出smtphost名字...



hi...
i got a code for send email to mail...
but i dint know how to give the smtphost name...

System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("yoursmtphost");



你能说怎么做?


can u say how to do this ?

推荐答案

看到这个



如何通过asp.net发送电子邮件 [< a href =http://www.codeproject.com/Answers/255410/How-to-send-email-through-asp-net#answer2target =_ blanktitle =New Window> ^ ]



编辑--->



要发送电子邮件,您需要一台主机。如果您的公司有这样配置的主机,请询问相关人员的主机地址和凭据。



如果您没有任何此类主机,则可以使用gmail主机服务器。

使用gmail服务器发送邮件检查上面的链接
See this

How to send email through asp.net[^]

EDIT --->

To send email you need one host. If your company is having such configured host then ask concerned person for host address and credentials.

If you dont have any such own host then you can use gmail host server.
to send mail using gmail server check the above link


字面上给出SMTP主机名:你将放入Outlook帐户设置的外发邮件服务器引用:

Literally give the SMTP Host name: the outgoing mail server reference you would put into an outlook account setup:
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.talktalk.net");









我用过这段代码......





"i used this code..."

System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add("training@bellatrix.in");
message.Subject = "This is the Subject line";
message.From = new System.Net.Mail.MailAddress("raghupathirajamca@gmail.com");
message.Body = "hi";
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.Send(message);



它在最后一行显示错误ya





错误实际上可能是因为gmail需要验证 - 它需要知道你是你,而不是我试图从你的帐户发送邮件。这意味着你需要设置凭据字段。



看看这个提示:它包含一个通用的电子邮件例程:使用或不带附件在C#中发送电子邮件:通用例程。 [ ^ ]


如果您通过Gmail发送邮件

使用smtp.gmail.com作为主持人
If you are sending mail through gmail
use "smtp.gmail.com" as host


这篇关于如何查找SMTP主机名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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