title: Spring mail - username in form of an email
body: <p>I want to be able to use my own email address at my own domain in my application.</p>
  
  <p>I have defined the following:</p>
  
  <pre><code>spring.mail.host=smtp.gmail.com
  spring.mail.username=example
  spring.mail.password=*****
  spring.mail.protocol=smtp
  spring.mail.port=587
  </code></pre>
  
  <p>Which works great. However, when I am switching to my own domain, and set the info:</p>
  
  <pre><code>spring.mail.host=da16.domeny.com
  spring.mail.username=contact@mydomain.com
  spring.mail.password=*****
  spring.mail.protocol=smtp
  spring.mail.port=587
  </code></pre>
  
  <p>Console reads:</p>
  
  <p>2016-09-01 15:16:37,475 ERROR o.a.c.c.C.[.[.[.[dispatcherServlet]: </p>
  
  <blockquote>
    <p>Servlet.service() for servlet [dispatcherServlet] in context with path
    [] threw exception [Request processing failed; nested exception is
    org.springframework.mail.MailSendException: Failed messages:
    javax.mail.SendFailedException: Invalid Addresses;   nested exception
    is:   com.sun.mail.smtp.SMTPAddressFailedException: 550 Nieprawidlowy
    adres nadawcy / incorrect envelope address ; message exceptions (1)
    are: Failed message 1: javax.mail.SendFailedException: Invalid
    Addresses;</p>
  </blockquote>
  
  <p>When I am trying to send an email. My domain provider says to specify my full email in username when I am trying to connect using smtp. Any ideas why it may not be working? </p>