我正在为我在 Rails 上的网站填写联系表格。我发送电子邮件,我收到了带有主题的电子邮件,往返于;但身体是空白的。这里的代码:
contact_mailer.rb
class ContactMailer < ActionMailer::Base
default from: "noreplay@hybrid-tech.net"
default to: "info@hybrid-tech.net"
def new_message(contact_message)
@contact_message = contact_message
mail(subject: "Send it from Hybrid Tech Website - #{@contact_message.subject} ")
end
end
风景
contact_email.html.erb
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<h1>Name: <%= @contact_message.name %></h1>
<h1>E-Mail: <%= @contact_message.email %></h1>
<p>
Message: <%= @contact_message.body %><br/>
</p>
</body>
</html>
有没有人知道这里有什么问题。
谢谢!!!