Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8355399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:51:00+00:00 2026-06-09T09:51:00+00:00

Is it possible to send email from my computer(localhost) using asp.net project in C#?

  • 0

Is it possible to send email from my computer(localhost) using asp.net project in C#?
Finally I am going to upload my project into webserver but I want to test it before uploading.

I’ve found ready source codes and tried run them in localhost, but neither of them work succesfully.
For example this code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Net.Mail;

    namespace sendEmail
    {
        public partial class _default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {

            }
            protected void Btn_SendMail_Click(object sender, EventArgs e)
            {
                MailMessage mailObj = new MailMessage(
                    txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);
                SmtpClient SMTPServer = new SmtpClient("localhost");
                try
                {
                    SMTPServer.Send(mailObj);
                }
                catch (Exception ex)
                {
                    Label1.Text = ex.ToString();
                }
            }
        }
    }

So how to send email using asp.net C#? Should I setup some server configurations?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T09:51:03+00:00Added an answer on June 9, 2026 at 9:51 am

    Sending Email from Asp.Net:

        MailMessage objMail = new MailMessage("Sending From", "Sending To","Email Subject", "Email Body");
        NetworkCredential objNC = new NetworkCredential("Sender Email","Sender Password");
        SmtpClient objsmtp = new SmtpClient("smtp.live.com", 587); // for hotmail
        objsmtp.EnableSsl = true;
        objsmtp.Credentials = objNC;
        objsmtp.Send(objMail);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Sending HTML email from PHP Using PHP to send an email. I
Is it possible to send an email from my Java application using a GMail
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: Sending HTML email from PHP I need to send an html mail
As the title said: Is it possible to send an email (using php mail())
Is it possible in Android to programmatically send an email using the phone's associated
Possible Duplicate: Sending email in .NET through Gmail I am trying to send a
Is it possible to silently send an email from a Windows Phone 7 device?
Possible Duplicates: iPhone send email not using MessageUI Locking the Fields in MFMailComposeViewController I
Possible Duplicate: Sending email in .NET through Gmail Say I want to send an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.