-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
System Information
- Ruby 3.3.5
- Rails 7.1.5.1
- Mac OS 15.5 (24F74)
Steps to Reproduce
rails new mailer-test- add gem to Gemfile
gem "mail-x_smtpapi-ksr"andbundle install - add random mailer under mailers
class RandomMailer < ApplicationMailer
default from: 'notifications@example.com'
def welcome_email(recipient)
@recipient = recipient
@url = 'http://example.com/login'
# Set the SMTP API category to 'test'
mail.smtpapi.category = 'test'
mail(
to: recipient,
subject: 'Welcome to Our Application!'
)
end
end
- start
rails console
mail = RandomMailer.welcome_email('test@example.com')
puts mail.to_s
app/mailers/random_mailer.rb:9:in welcome_email': undefined method smtpapi' for an instance of Mail::Message (NoMethodError)
This was experienced in a production app:
NoMethodError: undefined method `smtpapi' for an instance of Mail::Message
from /bundle/ruby/3.3.0/gems/mail-2.8.1/lib/mail/message.rb:1389:in `method_missing'
before testing on the new rails app. any info is greatly appreciated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels