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

  • Home
  • SEARCH
  • 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 8547673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:18:58+00:00 2026-06-11T13:18:58+00:00

i am trying to send email from c# windows application and i need SMTP

  • 0

i am trying to send email from c# windows application and i need SMTP Server Address to send email but i don’t know about SMTP Server Address, what is SMTP Server Address, how to get SMTP Server Address and how to use it.

this is the code:

System.Web.Mail.MailMessage message=new System.Web.Mail.MailMessage();
message.From="from e-mail";
message.To="to e-mail";
message.Subject="Message Subject";
message.Body="Message Body";
System.Web.Mail.SmtpMail.SmtpServer="SMTP Server Address";
System.Web.Mail.SmtpMail.Send(message);
  • 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-11T13:18:59+00:00Added an answer on June 11, 2026 at 1:18 pm

    First, the System.Web.Mail namespace utilities are marked as ‘obsolete’ and should not be used. Instead, you should use System.Net. In that namespace there is a ‘MailMessage’ and an ‘SmtpClient’ class that will do the job you are trying to do.

    Next, an SMTP server is a process that runs on a computer, which, when connected to the inetrnet, can listen for, and respond to, incoming requests which use a particular protocol on a particular port. You can think of an SMTP server as the machine at the post office that sorts and routes the mail to the appropriate mailbox.
    .
    An SMTP server has an address, just like everything else on the internet that needs to communicate with anything else. The address is used to send your mail message to the right machine, on the right communication channel. you could think of it as its phone number, and your mail message a text that will be sent to it.

    Next, the address you are looking for, last time I checked, was: smtp.gmail.com.
    So, considering that you need to stop using System.Web.Mail, and considering that your address may be smtp.gmail.com, here is what your code should look like:

            // setup mail message
            MailMessage message = new MailMessage();
            message.From = new MailAddress("from e-mail");
            message.To.Add(new MailAddress("to e-mail"));
            message.Subject = "Message Subject";
            message.Body = "Message Body";
    
            // setup mail client
            SmtpClient mailClient = new SmtpClient("smtp.gmail.com");
            mailClient.Credentials = new NetworkCredential("youraccount@gmail.com", "yourGmailPassword");
    
            // send message
            mailClient.Send(message);
    

    Also, here is a decent looking article on using gmail as your smtp server:
    How to use Gmail as your SMTP server

    Also, if gmail does not work for you, you can use the smtp server of your internet provider. They will usually have their smtp address lurking on their website somewhere to be helpful to customers who want to setup their email program. You can also look in Outlook under account settings if you cannot find it somewhere else, if you use anything besides gmail, you should find one there.

    Lastly, keep in mind, email cannot be sent without using an smtp server which is willing to receive and dispatch your maill message. In general this is something like gmail, or the smtp server of your internet provider, and the address will normally be: smtp.providername.com. However, gmail, for example, requires your account credentials for the smtp server to allow your message to be received and dispatched.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send an email from a Ruby program. The smtp server
I am trying to send email using gmail from my mvc application. I am
I am trying to send a sample email from my rails application. this is
I'm trying to send an email from my application with a PHP contact form,
I'm trying to send an email from a Metro application (js or c#, doesn't
I'm trying to send an email from c# code via our company's exchange server.
I am trying to send an HTML email from my app with MFMailComposeViewController, but
I am trying to send a test email from my IIS it has SMTP
I am trying to send an email from a site I am building, but
I'm trying to send an email from a perl script but I'm having a

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.