Rails mailer mimepart visible as text in message body

后端 未结 1 1101
孤街浪徒
孤街浪徒 2021-02-09 03:34

I\'m sending test mail using ActionMailer. The template is being rendered and mail is being delivered fine. The only problem is the mimepart and other header data is displayed b

相关标签:
1条回答
  • 2021-02-09 03:51

    Don't specify :content_type => "text/html" in your mail method. Since you're using format block, rails will automatically pick up mime type.

    MORE DETAILS:

    Try this to send out multipart email (ie. both html and text formats of email). Notice the order of formats.

    mail(:to => "apoorvparijat@gmail.com", :subject => "html mailer") do |format|
        format.text { render :text => "bing" }
        format.html { render 'testing' }
    end
    
    0 讨论(0)
提交回复
热议问题