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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:31:18+00:00 2026-06-08T14:31:18+00:00

I want to Run Below code without NetworkCredential nc = new Net.NetworkCredential(USERNAME, PASSWORD). BY

  • 0

I want to Run Below code without

NetworkCredential nc = new Net.NetworkCredential("USERNAME", "PASSWORD"). 

BY using Only Exchange Host (Server Name) And Port

Im Getting Error For this code : Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender

protected void SendEmail(object sender, EventArgs e)
{
    SmtpClient smtpClient = new SmtpClient("ExchangeServerName",25);
    MailMessage message = new MailMessage();
    try
    {
        MailAddress fromAddress = new MailAddress("bala@OfficeName.com", "From Me");
        MailAddress toAddress = new MailAddress("bala@OfficeName.com", "To You");
        message.From = fromAddress;
        message.To.Add(toAddress);
        message.Subject = "Testing!";
        message.Body = "This is the body of a sample message";
        smtpClient.UseDefaultCredentials = true;
        System.Net.NetworkCredential nc = CredentialCache.DefaultNetworkCredentials;
        smtpClient.Credentials = (System.Net.ICredentialsByHost)nc.GetCredential("ExchangeServerName", 25, "Basic");
        smtpClient.Send(message);
        lblText.Text ="Email sent.";
    }
    catch (Exception ex)
    {
        lblText.Text = "Coudn't send the message!\n  " + ex.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-08T14:31:21+00:00Added an answer on June 8, 2026 at 2:31 pm

    I have done it. For more details about my code use this link.

    Below Code is worked Fine with

    Server : Windows Server 2003,Windows Server 2008,Windows Server 2008 R2

    IIS : 6.0, 7.0

    .Net Frame Wotk : 2.0,3.5,4.0

    string sMessage;
    SmtpClient smtpClient = new SmtpClient();
    MailMessage message = new MailMessage();
    try
    {
    
     //you can provide invalid from address. but to address Should be valil
    MailAddress fromAddress = new MailAddress("bala@technospine.com", "BALA");
    
    smtpClient.Host = "Exchange Server Name";
    smtpClient.Port = 25;
    //smtpClient.Port = 587;
    
    
    smtpClient.UseDefaultCredentials = true; 
    
    message.From = fromAddress;
    message.To.Add(bala@technospine.com); //Recipent email 
    message.Subject = _subject;
    message.Body = _details;
    message.IsBodyHtml = true;
    
    //smtpClient.EnableSsl = true; 
    
    smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
    
    smtpClient.Send(message); 
    
    sMessage = "Email sent.";
    }
    catch (Exception ex)
    {
    sMessage = "Coudn't send the message!\n " + ex.Message;
    }
    
    
    lblMailStatus.Text = sMessage;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run code which needs boost libraries. I built it using CMake.
I am using the code below to start ror server. Is there a easy
I'm fairly new to ggplot. I have made a bumpplot using code posted below.
I have two jQuery functions. The first one below I want to run first,
Why this code don't work,when i want run this code vwd 2008 express show
I have written php program and uploaded on server. I want run this program
I want to run wget as follows shell_exec('wget 'http://somedomain.com/somefile.mp4''); sleep(20); continue my code... What
I have the code below. I want to send the value of value1 n.value1s
I have the below code to run a java program from a file. import
Inside an event in my code behind file I want to run a script

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.