kezack
پنج شنبه 31 مرداد 1387, 22:23 عصر
با سلام من می خوام از طریق میل هاست برای افراد میل بفرستم ولی با این خطا مواجه شدم لطفا کمکم کنید
No connection could be made because the target machine actively refused it 127.0.0.1:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25
Source Error:
Line 29: Line 30: Line 31: smtp.Send(mail);Line 32: }Line 33: کد برنام این هست
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Persia;
using System.Net.Mail;
using System.ComponentModel;
publicpartialclass TirUser_CountantUs : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid btnadd_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("admin@tirkaranco.com");
mail.To.Add("taha_tmm@yahoo.com");
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email .";
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
No connection could be made because the target machine actively refused it 127.0.0.1:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25
Source Error:
Line 29: Line 30: Line 31: smtp.Send(mail);Line 32: }Line 33: کد برنام این هست
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Persia;
using System.Net.Mail;
using System.ComponentModel;
publicpartialclass TirUser_CountantUs : System.Web.UI.Page
{
protectedvoid Page_Load(object sender, EventArgs e)
{
}
protectedvoid btnadd_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.From = new MailAddress("admin@tirkaranco.com");
mail.To.Add("taha_tmm@yahoo.com");
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email .";
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}