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