[SocketException (0x274d): No connection could be made because the target machine actively refused it 127.0.0.1:25]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +208
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +464
[WebException: Unable to connect to the remote server]
System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6) +6646520
System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) +307
System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +19
System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +324
System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) +141
System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint) +170
System.Net.Mail.SmtpClient.GetConnection() +44
System.Net.Mail.SmtpClient.Send(MailMessage message) +1554
[SmtpException: Failure sending mail.]
System.Net.Mail.SmtpClient.Send(MailMessage message) +1906
ContactUs.SendDetails() in d:\ClickPerks\ClickPerks\httpdocs\ContactUs.aspx.cs:48
ContactUs.btnSubmit_Click(Object sender, EventArgs e) in d:\ClickPerks\ClickPerks\httpdocs\ContactUs.aspx.cs:54
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9628114
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
private void SendDetails()
{
System.Text.StringBuilder oBuilder = new System.Text.StringBuilder();
oBuilder.Append("Email=" + txtEmail.Text + Environment.NewLine);
oBuilder.Append("Name=" + txtName.Text + Environment.NewLine);
oBuilder.Append("Subject=" + txtSubject.Text + Environment.NewLine);
oBuilder.Append("Message=" + txtDetails.Text);
MailMessage oMM = new MailMessage();
oMM.From = new MailAddress("info@clickperks.com");
try
{
oMM.ReplyTo = new MailAddress("info@clickperks.com");
}
catch
{
}
oMM.Subject = txtSubject.Text;
oMM.Body = oBuilder.ToString();
oMM.To.Add(ConfigurationManager.AppSettings.Get("ContactUsReceiverEmailID").ToString());
SmtpClient client = new SmtpClient();
client.Host = ConfigurationManager.AppSettings.Get("SMTPServerName").ToString();
client.Send(oMM);
}
public void btnSubmit_Click(object sender, EventArgs e)
{
if (IsValid)
{
SendDetails();
lblConfirmation.Text = "<br>Your details have been successfully submitted. You should receive a response from us within two business days.<br>";
txtEmail.Text = "";
txtName.Text = "";
txtSubject.Text = "";
txtDetails.Text = "";
}
}
What I have tried:
Here actually I tried removing windows firewall, proxy, restarted VS but didn't work.I don't have any knowledge on webservice, if this error is related to that. Please help me out in this. I'm receiving error in
client.Send(oMM);
line