Email sendig APP

Hi All

I have created one email sending app through Phoenix though I am getting an error of
function EmailSender.MessageController.init/1 is undefined (module EmailSender.MessageController is not available)

kindly help

Thanks :slight_smile:

Hello @RichaGupta

Well, the error is clear…

You don’t have the module. Either because You made a typo, or because You used EmailSender instead of EmailSenderWeb.

Controllers are on the web part… my guess is You should use EmailSenderWeb.

Try to understand the error, because error messages are meant to be first class citizens in Elixir.

And as You start with Elixir, that will happen more than once.

Until You meet dialyzer, then You will need to take a special course on type error.

Next steps,

  • Create a tableless schema, for validation purpose (oh well, this one is hard, if You have never used Ecto)

  • Add a new and create action, put the contact form, and get the params

  • Hooks this to smtp, via whatever mailer You choose

Good luck with your work…

1 Like

Thnaks,

I am facing problem can anybody help me with below query:
After creation of mail body when i am clicking on submit button after some seconds my server is closing.

Nobody can guess why… but my bet is You have made an error.

As an elixir and phoenix newcomer I often run my dev server using Elixir’s interactive shell: https://hexdocs.pm/iex/IEx.html

When I start my server I use iex -S mix phx.server so that I can see everything going on with the server. You might find this a useful place to start with troubleshooting.

3 Likes

At least You should provide the error in your question :slight_smile:

and maybe what You have done to get this error.

2 Likes

Can you post the error message you’re getting? It seems weird that the server would simply close by itself without outputting any kind of error message and posting that error message would help us find out what’s happening so that we can help you :slight_smile:

Also, it also seems you’re kind of new to Phoenix, like we all were at some point, so I’d advise you to read its documentation: Phoenix: Up And Running.

1 Like

My query is getting killed each time due to which server stops.
[debug] QUERY OK db=9.1ms
INSERT INTO “messages” (“body”,“subject”,“to”,“inserted_at”,“updated_at”) VALUES ($1,$2,$3,$4,$5) RETURNING “id” [“jdffbgttewyh46huu6”, “testing of API”, “parseprati15@gmail.com”, {{2020, 2, 19}, {10, 38, 31, 135580}}, {{2020, 2, 19}, {10, 38, 31, 137714}}]
Killed

Isn’t there any more output after the "Killed" message?
We can see that you’re inserting something into the database but it seems it does so successfully so this doesn’t clearly state why it was killed.

You should probably install Erlang and Elixir through asdf and retry.