gotthardp / rabbitmq-email

SMTP Gateway Plugin for RabbitMQ
Mozilla Public License 2.0
180 stars 20 forks source link

Unable to send mail #51

Closed a-marcellini closed 2 years ago

a-marcellini commented 2 years ago

You are syncing the dev. version of gen_smtp, however in the readme you declare the dependency to the 1.1.1. What's more I'm not sure if your code acknowledges the mimemail encode modification: from list to map. here the code

I'm not an erlang expert, however, I think that the code doesn't use maps as parameter but it uses lists:

Look at rabbit_email_sender.erl row 22 as an example, 4th parameter: Message = mimemail:encode({Type, Subtype, lists:foldr(fun set_header/2, [], Headers2), [], Payload}),

I succesfully tested the following fix: Message = mimemail:encode({Type, Subtype, lists:foldr(fun set_header/2, [], Headers2), #{}, Payload}),

I'm going to create a branch and a pull request.

lukebakken commented 2 years ago

I misread the gen_smtp code, sigh. I'll get this fixed.

lukebakken commented 2 years ago

Fixed in https://github.com/gotthardp/rabbitmq-email/commit/a345674934f9a40ed8f13987437358a55422a407