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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:30:25+00:00 2026-06-08T13:30:25+00:00

When I remove the comment //stmp.timeout it gives timeout error. What should I do

  • 0

When I remove the comment “//stmp.timeout” it gives timeout error. What should I do to fix that?

Here is my code:

public ActionResult Index(EmailModel model)
{
    var smtp = new System.Net.Mail.SmtpClient();
    {
        smtp.Host = "smtp.gmail.com";
        smtp.Port = 180;
        smtp.EnableSsl = true;
        smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
        smtp.Credentials = new NetworkCredential("sheikh.abm@gmail.com ","somepassword");
        //smtp.Timeout = 20000;
    }
    try
    {
        smtp.Send("sheikh.abm@gmail.com",model.To, model.Subject, model.Message);
        return View("Index");
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex);   //Should print stacktrace + details of inner exception
         if (ex.InnerException != null)
         {
             Console.WriteLine("InnerException is: {0}", ex.InnerException);
         }
    }
    return View("Index");
  • 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-08T13:30:27+00:00Added an answer on June 8, 2026 at 1:30 pm

    In this line

    smtp.Credentials = new NetworkCredential("sheikh.abm@gmail.com ","somepassword
    

    there is a space after gmail.com. This could prevent the login to gmail. Remove it.
    Also, I think that the port used to send mail to gmail is 465 for SSL or 587 for TLS/STARTTLS.

    smtp.Port = 465;   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some code that should remove the parent row of the clicked td
I have a remove link that will remove the current comment on my page.
Since when did: //echo [$sql][$result][$rows][$e]<BR>; cause an error? The code following this comment gets
The following code prints *1. What's mystifying is if I remove the comment it
Is there any way to completely remove the comment with the copyright notice when
Couldn't comment on this post, which states the problem I'm experiencing: jQuery remove() on
Is there anyway or any addin for VS2010 that can remove all the comments
how to remove comment lines (as # bal bla ) and empty lines (lines
How to make simple working ( only if i remove/comment prototype ) example to
I want remove html comment tag <!--QuoteEnd--></div><!--QuoteEEnd--> <!--hide me-->Abc<!--hide me--> after remove </div> Abc

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.