title: SMTPClient takes too long to send asp.net email
body: <p>I have here a bunch of code regarding SMTPClient Send mail:</p>
  
  <pre><code>  public void SendEmailToCustomer(ReservationDetails reservationDetails, string reason, string cardtype) {
  
      MailMessage msg = new MailMessage(ConfigurationManager.AppSettings["Email.Sender"], reservationDetails.Email);
  
      msg.Subject = this.Subject;
      msg.Body = this.Body.Replace("[InvoiceNumber]", reservationDetails.Invoice)
        .Replace("[GuestName]", reservationDetails.Name)
        .Replace("[GuestTelephone]", reservationDetails.Telephone)
        .Replace("[GuestEmail]", reservationDetails.Email)
        .Replace("[GuestAddress]", reservationDetails.Address)
        .Replace("[GuestCompany]", reservationDetails.CompanyName)
        .Replace("[GuestCompanyAddress]", reservationDetails.CompanyAddress)
        .Replace("[GuestCompanyNumber]", reservationDetails.CompanyNumber)
        .Replace("[OtherRemarks]", reservationDetails.Other)
        .Replace("[TransferDescription]", reservationDetails.TransferDescription)
        .Replace("[FlightArrivalDate]", reservationDetails.ArrivalDate)
        .Replace("[ETA]", reservationDetails.ETA)
        .Replace("[FlightArrival]", reservationDetails.FlightArrival)
        .Replace("[FlightDepartureDate]", reservationDetails.DepartureDate)
        .Replace("[ETD]", reservationDetails.ETD)
        .Replace("[FlightDeparture]", reservationDetails.FlightDeparture)
        .Replace("[NoOfNights]", reservationDetails.NoOfNights)
        .Replace("[CheckIn]", reservationDetails.CheckIn)
        .Replace("[CheckOut]", reservationDetails.CheckOut)
        .Replace("[RoomName]", reservationDetails.RoomName)
        .Replace("[Qty]", reservationDetails.Qty)
        .Replace("[RoomAmount]", String.Format("{0:N}", Convert.ToDecimal(reservationDetails.RoomAmount)))
        .Replace("[RateRoom]", String.Format("{0:N}", Convert.ToDecimal(reservationDetails.RateRoom)))
        .Replace("[NumExtra]", Convert.ToString(reservationDetails.NumExtra))
        .Replace("[ExtraAmount]", String.Format("{0:N}", Convert.ToDecimal(reservationDetails.ExtraAmount)))
        .Replace("[RateExtra]", String.Format("{0:N}", Convert.ToDecimal(reservationDetails.RateExtra)))
        .Replace("[RTTQty]", Convert.ToString(reservationDetails.RTTQty))
        .Replace("[RTT]", String.Format("{0:N}", Convert.ToDecimal(reservationDetails.RTT)))
        .Replace("[RTTAmount]", String.Format("{0:N}", Convert.ToDecimal(reservationDetails.RTTAmount)))
        .Replace("[TotalAmount]", String.Format("{0:N}", Convert.ToDecimal(reservationDetails.TotalAmount)))
        .Replace("[ModePay]", reservationDetails.ModePayment)
        .Replace("[Reason]", "Reason: " + reason)
        .Replace("[CardType]", cardtype)
                   ;
  
      msg.CC.Add(this.AddressCC);
      msg.Bcc.Add(this.AddressBCC);
      msg.IsBodyHtml = true;
  
      try {
        SmtpClient client = new SmtpClient(ConfigurationManager.AppSettings["Smtp.Client"]);
        client.Credentials = new System.Net.NetworkCredential(ConfigurationManager.AppSettings["Smtp.Credentials.Username"], ConfigurationManager.AppSettings["Smtp.Credentials.Password"]);
        client.Send(msg);
  
  
      } catch (Exception ex) {
        //Do nothing
        //throw new Exception("Couldn't send email: &lt;p&gt;" + ex.Message);
      } finally {
        msg.Dispose();
      }
  
    }
  </code></pre>
  
  <p>It takes too long to send an email (approx. 5 seconds).
  I also disposed MailMessage.</p>
  
  <p>What could be the possible cause of the email delay. And how can I resolve the issue? </p>
  
  <p>Many thanks!! :D</p>