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 9121283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:49:34+00:00 2026-06-17T05:49:34+00:00

SmtpClient emailClient = new SmtpClient(MailServer); System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential(sender_mail_id(organisation mail id), pwd); emailClient.UseDefaultCredentials

  • 0
SmtpClient emailClient = new SmtpClient(MailServer);
System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential(sender_mail_id(organisation mail id), pwd);
emailClient.UseDefaultCredentials = false;
emailClient.Credentials = SMTPUserInfo;

emailClient.Port = 587;
emailClient.Send(msg);

Above code for sending mail is working. I would like to configure my own port (my outlook outgoing server port) ie instead of 587. How to do that? (My organisation outlook id is attached with yahoo id)

  • 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-17T05:49:35+00:00Added an answer on June 17, 2026 at 5:49 am

    Here is something that you can use to follow for example use it anyway you like to fit your example

        MailMessage mailMsg = new MailMessage();
        mailMsg.To.Add("somEmailAddress@SomMailHost.com");
        // From
        MailAddress mailAddress = new MailAddress("spongebob@sandymail.com");
        mailMsg.From = mailAddress;
    
        // Subject and Body
        mailMsg.Subject = "subject";
        mailMsg.Body = "body";
    
        // Init SmtpClient and send on port 587
        SmtpClient emailClient = new SmtpClient("mailserver", 587);
        System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("username", "password");
        emailClient.Credentials = credentials;
        emailClient.Send(mailMsg);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking in this StackOverflow question it uses the following to send emails: System.Net.Mail.SmtpClient Is
I'm sending attachments using the System.Net.Mail.SmtpClient in C#. The attachment names are the same
When using the system.net/mail web.config settings to configure my SmtpClient, it fails to deliver
'Variable which will send the mail Dim obj As System.Net.Mail.SmtpClient 'Variable to store the
I'm attempting to use the System.Net.Mail.SmtpClient class to relay an email through my company's
I'm having a very difficult and strange problem Authenticating with System.Net.Mail.SMTPClient. I need to
So I've been using System.Net.Mail.MailMessage objects for sending e-mail via SmtpClient for a while
I have the following class: public class Email { public System.Net.Mail.SmtpClient SmtpClient { get
SmtpClient smtpClient = new SmtpClient(smtp.gmail.com); smtpClient.Credentials = new NetworkCredential(xxxxx@gmail.com, password); smtpClient.Port = 587; smtpClient.EnableSsl
I am trying to send mail using SmtpClient() within my Winforms VB.Net program Here

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.