title: Can i use IP Address as SMTP host rather then smtp.email.com
body: <p>i am creating an Email sending sample application, and i want to use send email from different email address like "gmail, yahoo, hotmail" so i don't want to use "smtp.email.com" as host, because if i use "smtp.email.com" as host i will have to change my host name for every different company like("smtp.gmail.com" for gmail or "smtp.mail.yahoo.com" for yahoo.com ) so 
  Can i use IP Address as SMTP host rather then smtp.email.com.</p>
  
  <p>Please give me a solution for this so that without changing smtp host name i can use different email company to send email.</p>
  
  <p>this is my code:</p>
  
  <pre><code>        try
          {
              // setup mail message
              MailMessage message = new MailMessage();
              message.From = new MailAddress(textBox1.Text);
              message.To.Add(new MailAddress(textBox2.Text));
              message.Subject = textBox3.Text;
              message.Body = richTextBox1.Text;
  
              // setup mail client
              SmtpClient mailClient = new SmtpClient("smtp.gmail.com");//here i have to change SMTP host for different email company 
              mailClient.Credentials = new NetworkCredential(textBox1.Text,"password");
  
              // send message
              mailClient.Send(message);
  
              MessageBox.Show("Sent");
          }
          catch(Exception)
          {
              MessageBox.Show("Error");
          }
  </code></pre>