Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

office365 smtp session #156

Closed
Ender-Wiggin opened this issue Jan 21, 2019 · 2 comments
Closed

office365 smtp session #156

Ender-Wiggin opened this issue Jan 21, 2019 · 2 comments

Comments

@Ender-Wiggin
Copy link

Hi there,

I'm having trouble with sending emails via office365. I've tried gmail and it works fine but this isn't working for some reason. Here's my config:

Play mailer

play.mailer {
host = "smtp.office365.com"
port = 587
tls = true
user = "[email protected]"
password = "test"
props {
starttls.enable = true
starttls.required = true
}
}

I get this error:
Sending the email to the following server failed : smtp.office365.com:587

Has anyone experienced anything similar?

Thanks!

@mkurz
Copy link
Member

mkurz commented Jan 21, 2019

Can you provide more information about the error?

@Ender-Wiggin
Copy link
Author

Hi thanks for the quick response! I realised I was just being stupid now and have fixed the issue. I tested with raw Javax code in issue98 #98 and it worked fine. I then realised that in the actual email send function I hadn't updated the actually send function, so the email was being rejected.

mailerClient.send(Email(
  subject = subject,
  **from = "[email protected]",**
  to = to,
  cc = cc.getOrElse(Seq.empty),
  bcc = bcc.getOrElse(Seq.empty),
  bodyText = bodyText,
  bodyHtml = bodyHtml
))

it works now thanks! Is there a way of inheriting the "from" field from the username in config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants