मैं अपने रेल ऐप में एक्शन मेलर का उपयोग करके ईमेल भेज रहा हूं। लेकिन यह केवल एक डिफ़ॉल्ट प्रेषक की अनुमति देता है।रेल: कार्रवाई मेलर में डिफ़ॉल्ट प्रेषक को बदलें
class UserMailer < ActionMailer::Base
default :from => "[email protected]"
def welcome_email(user, order)
@user = user
@order = order
mail(:to => user.email, :subject => "Your Order")
end
def signup_email(user)
@user = user
mail(:to => user.email, :subject => "Thank you.")
end
def invite_confirm(curuser,usemail,post)
@greeting = "Hi"
@user = curuser
@post = post
mail(:to => user.email, :subject => "Hello")
end
end
मैं इस कोशिश की:
class UserMailer < ActionMailer::Base
def welcome_email(user, order)
@user = user
@order = order
mail(:to => user.email, :subject => "Your Order", :from => "[email protected]")
end
def signup_email(user)
@user = user
mail(:to => user.email, :subject => "Thank you.", :from => "[email protected]")
end
def invite_confirm(curuser,usemail,post)
@greeting = "Hi"
@user = curuser
@post = post
mail(:to => user.email, :subject => "Hello", :from => "[email protected]")
end
end
लेकिन फिर भी यह "[email protected]"
से ईमेल भेज रहा है किसी भी तरह के लिए इस बदलने के लिए वहाँ है यह मेरा UserMailer वर्ग है UserMailer क्लास में लिखी गई प्रत्येक विधि? क्या मुझे कहीं और बदलना है?
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => "587",
:domain => "gmail.com",
:authentication => "plain",
:user_name => "[email protected]",
:password => "example",
:enable_starttls_auto => true
}
मुझे लगता है, मैं यहाँ कुछ भी परिवर्तन नहीं होना चाहिए:
config/वातावरण/development.rb और config/वातावरण/production.rb में मैं इस किया है।
अरे, मैं विभिन्न उपयोगकर्ताओं से ईमेल भेजना चाहता हूं। मैंने अपना प्रश्न अपडेट किया। क्या आप इसकी मदद कर सकते हैं? – user2206724
आपको कई ईमेल भेजने की आवश्यकता है :) – e3matheus