-1

I'm trying to send 2 emails on the same function but after send the log show

An SMTP To address is required to send a message. Set the message smtp_envelope_to, to, cc, or bcc address

if i remove one email works, and everything is configured ok.

someone can know about this issue?

def dispute_confirmation(dispute)
    @dispute = dispute


    mail(to: @dispute.buyer.email, subject: 'Reclamação Aberta', &:html)

     mail(to: @dispute.seller.email, subject: 'Comprador abriu uma Reclamação', &:html)


  end
hujje
  • 1
  • 1

1 Answers1

0

Looks like you have an underscore in there instead of a period.

def dispute_confirmation(dispute)
  @dispute = dispute

  mail(to: @dispute.buyer.email, subject: 'Reclamação Aberta', &:html)
  mail(to: @dispute.seller.email, subject: 'Comprador abriu uma Reclamação', &:html)
end
chrisxrobertson
  • 745
  • 6
  • 9
  • Hello @chrisxrobertson, thank you, i changed this error and the same, is not possible to send 2 emails on the same function in rails? – hujje May 27 '17 at 00:25
  • I'm not sure why that doesn't work, sorry. Does this help? https://stackoverflow.com/q/14727042/1576860 – chrisxrobertson May 27 '17 at 00:38