title: No qualifying bean of type [org.springframework.mail.javamail.JavaMailSender] while deploying service into PCF
body: <p>Hi I am trying to deploy a service which uses Spring Mail to send email. The service is working in my local IDE and I am trying deploy it in PCF cloud. I did a gradle build and have manifest.yml file on the class path. When I push it the app failed to start with following exception. Is that something I am missing or PCF behavior or email service will not in cloud?</p>
  
  <p>I am using spring boot and I have all the required properties which helps to create a bean for mail in my application.properties file. It is completely working in my local.</p>
  
  <pre><code>     Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: 
  private org.springframework.mail.javamail.JavaMailSender com.send.SendController.mailSender; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: 
  No qualifying bean of type [org.springframework.mail.javamail.JavaMailSender] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
  </code></pre>
  
  <p>Update:</p>
  
  <pre><code>@Autowired
  private JavaMailSender mailSender;
  
  private void sendEmail(String[] emails) {
  
      SimpleMailMessage message = new SimpleMailMessage();
      message.setFrom("************");        
      message.setTo(emails);
      message.setSubject("Hello");
      message.setText("Test mail from Spring!!!");
      mailSender.send(message);
  
  }
  </code></pre>
  
  <p>application.properties</p>
  
  <h1>mail properties</h1>
  
  <pre><code>spring.mail.host=smtp.gmail.com
  spring.mail.port=587
  spring.mail.password=***********
  spring.mail.username=*********
  spring.mail.properties.mail.transport.protocol=smtp
  spring.mail.properties.mail.smtp.auth=true
  spring.mail.properties.mail.smtp.starttls.enable=true
  spring.mail.properties.mail.debug=true
  spring.mail.properties.mail.smtp.timeout=1000
  spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
  spring.mail.properties.mail.smtp.ssl.enable = true
  </code></pre>
  
  <p>I have one more doubt, in my local it connects to internet to verify email and send email. How that it connects to internet in Cloud? I am new and appreciate help!</p>