The error seems to be very non-descriptive:
failed with ArgumentError: A sender (Return-Path, Sender or From) required to send a message
I think this is not the real problem since I’ve tried specifying “from” even though I set a default. Also, the code is identical for localhost and Heroku…
def invite_dealer(auction, name, email, dealer)
return false if dealer.bids.where("auction_id = ?", auction.id).present?
@name = name #used on template
@email = email
@auction = auction #this too
mail(:to => @email, :subject => "New Auction - #{auction.car.name}", :from => "realaddressishereonmymachine@ourdomain.com")
end
The error
failed with ArgumentError: A sender (Return-Path, Sender or From) required to send a messagecan occur ifmailmethod was not invoked frominvite_dealermethod.So putting conditional
returnintoinvite_dealermethod before call tomailmethod is bad idea.