email - target machine actively refused it

Discussion in 'Getting started' started by seal, Apr 20, 2012.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am trying to run this scipt, and I am getting this message:
    No connection could be made because the target machine actively refused it 127.0.0.1:25

    <%@ Import Namespace="System.Net.Mail" %>
    <script language="C#" runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
    //create the mail message
    MailMessage mail = new MailMessage();
    //set the addresses
    mail.From = new MailAddress("[email protected]");
    mail.To.Add("[email protected]");
    //set the content
    mail.Subject = "This is an email from script";
    mail.Body = "this is the body content of the email script.";
    //send the message
    SmtpClient smtp = new SmtpClient("localhost");
    smtp.Send(mail);
    lblMessage.Text = "Mail Sent";
    }
    </script>
    <html>
    <body>
    <form id="Form1" runat="server">
    <asp:Label id="lblMessage" runat="server"></asp:Label>
    </form>
    </body>
    </html>
     
  2. is the issue still persists? if it does, you need to open a support ticket from the portal.
    support.discountasp.net
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page