I built a Java Spring app that send mail through an OVH configuration, where I have a domain name and a mail service. To test on my localhost, I also tried to send mail with a Gmail configuration, which is working well. With the OVH configuration, I don't have any issue, except that I never receive the mail.
Do you have any advice to look at and that could cause the OVH service to be unsuccessful ?
Here is my configuration :
spring:
mail:
host: ssl0.ovh #smtp.gmail
port: 587
username: [email protected] #[email protected]
password: password
properties:
mail:
transport.protocol: smtp
smtp:
auth: true
starttls:
enable: true
required: true
test-connection: true
Thanks !
I built a Java Spring app that send mail through an OVH configuration, where I have a domain name and a mail service. To test on my localhost, I also tried to send mail with a Gmail configuration, which is working well. With the OVH configuration, I don't have any issue, except that I never receive the mail.
Do you have any advice to look at and that could cause the OVH service to be unsuccessful ?
Here is my configuration :
spring:
mail:
host: ssl0.ovh #smtp.gmail
port: 587
username: [email protected] #[email protected]
password: password
properties:
mail:
transport.protocol: smtp
smtp:
auth: true
starttls:
enable: true
required: true
test-connection: true
Thanks !
Share Improve this question asked Mar 23 at 1:48 BabCBabC 1,0848 silver badges21 bronze badges 2- Are you sure SMTP port for OVH is 587 not 465 ? – p3consulting Commented Mar 23 at 12:23
- I tried both 587 and 465 with the same result – BabC Commented Mar 23 at 15:53
1 Answer
Reset to default 0So after many hours looking for configuration on OVH website, I tried a node app... And it worked well. So the issue is in my java application.
I took a look at my parameters, and within my message I didn't fill all the informations, the recipient was missing. Apparently it doesn't bother gmail, but with OVH it won't work.
Here is the minimalist code to send the mail :
public void send() {
SimpleMailMessage message = new SimpleMailMessage();
message.setFrom("[email protected]");
message.setTo("[email protected]");
message.setSubject("Subject");
message.setText("Body");
mailSender.send(message);
}
And the configuration on my question is correct.