English 中文(简体)
我寄来的邮件没有在方框中找到。
原标题:my send mail not found in inbox
  • 时间:2010-12-27 17:17:19
  •  标签:
  • asp.net

i 希望在此处以印本形式寄送邮件是我的编码

protected void Button1_Click(object sender, EventArgs e)
{
  SmtpClient smtp = new SmtpClient("192.168.1.2",Convert.ToInt32 (25));
  System.Net.NetworkCredential cre = new System.Net.NetworkCredential();
  smtp.Credentials = cre;
  MailMessage message = new MailMessage();
  message.To.Add(new MailAddress("uamrit@gmail.com"));
  message.IsBodyHtml = true;
  message.Body = "<html><head><body><p> this is Demo for sending mail. </p></body></head></html>";
  message.Subject=("response from the web sitre");
  message.From = new MailAddress("uamrit@gmail.com");

  try
  {
    smtp.EnableSsl = false;
    smtp.UseDefaultCredentials = true;
    smtp.Send(message);
    Response.Write("Your Email has been sent sucessfully -");
  }
  catch (Exception exc)
  {
    Response.Write("Send failure: " + exc.ToString());
  }
}

页: 1

<system.net>
 <mailSettings>
  <smtp from="uamrit@gmail.com">
   <network host="192.168.1.299" port="25" userName="uamrit" password="*****"/>
  </smtp>
 </mailSettings>
</system.net>

this show mail send successfully but when we check my gmail account there no one mail for me why this happen. what the procedure to send mail plz send me full coding

问题回答

可能有多种原因。 你们是否在箱子里检查过你的SPAM? 我也看到,你正准备通过另一个服务器从GMAIL账户发送电子邮件,我相信GMAIL不会喜欢,也不会把你的电子邮件地址打上黑名单。

如果你计划使用GMAIL,那么为什么不使用GMAILSMTP环境?

在您的信中,你界定了用户名称和密码,然而,在您的法典中,你具体指明了用户名称和密码。

smtp.UseDefaultCredentials = true;

你们需要决定哪些人使用——违约全权证书,或会议中的用户名/密码?

我想,如果你在座标上用一个用户名/密码,你就不想凌驾于你的代码中,具体注明<代码>。 使用DefaultCredentials = 真实......

如果这确实没有解决你的问题,我将试图具体说明员工和管理当局协调会的邮件,以送交你选择的名录,并看该名录的邮件(储存为*.eml<>/code>文档)是否真的创建。 为此,利用这一会议:

<system.net>
 <mailSettings>
  <smtp from="uamrit@gmail.com" deliveryMethod="specifiedPickupDirectory">
     <specifiedPickupDirectory>C:	empmails</specifiedPickupDirectory>
  </smtp>
 </mailSettings>
</system.net>

你们需要确保所确定的名录已经存在,尽管!





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!