Mattgu74
Mattgu74

Reputation: 224

Mail function in OPA

Today I need to send email in my OPA apps. Then I'am trying to use opa functions about mail.

I am using the module : stdlib.web.mail. And the OPA version :

Opa compiler (c) MLstate -- version S3.5 -- build 320

Then, with function Email.try_send it's a blocking function and this function block the client long long time... (I have never seen this function terminate....)

Then I have tried to use the function Email.try_send_async, with a "callback function" like this :

(a-> jlog(Email.string_of_send_status(a)))

I have never seen in console or on client side any error or success message... It's useless to precise that I have never got email too :(

Then my questions are :

Upvotes: 3

Views: 377

Answers (2)

Mattgu74
Mattgu74

Reputation: 224

In fact the problem was linked to my adsl box which had a security option enabled. Security option was allowing only smtp of my ISP.

Maybe you must had something to detect it, and then throw an error more verbose than nothing :)

Upvotes: 0

hugo
hugo

Reputation: 11

I did not manage to reproduce your problem. I did try with the following:

import stdlib.web.mail
from = {name=none address={local="hugo" domain="opalansdfsdforg.fr"}}
to = {name=none address={local="youremail" domain="gmail.com"}}
_ = println("===Before")
r = Email.try_send(from,to,"subject",{text="great"})
_ = println("===Status {r}")
_ = println("===After")

What do you get if you execute this code (with --verbose option). ??

Upvotes: 1

Related Questions