title: Why do I get 5.5.4 Invalid Address error?
body: <p>I tried to send an email using the following code:</p>
  
  <pre><code>MailMessage message = new MailMessage();
  
          message.From = new MailAddress(fromMailAddress.Trim());
          message.To.Add(new MailAddress(toMailAddress.Trim()));
  
          message.Subject = subject;
          message.Body = body;
          message.SubjectEncoding = System.Text.Encoding.UTF8;
          message.BodyEncoding = System.Text.Encoding.UTF8;
          SmtpClient client = new SmtpClient();
          try
          {
              client.Send(message);
          }
          catch(Exception e)
          {
              throw e;
          }
  </code></pre>
  
  <p>However, I got the exception:</p>
  
  <blockquote>
    <p>The server response was: 5.5.4 Invalid Address</p>
  </blockquote>
  
  <p>The from email, to email, server host name and port are all correct. The exact same code, with exact same input values works on another machine in our office</p>