Note that there are some explanatory texts on larger screens.

plurals
  1. PORails mailer and links not working under Thunderbird
    primarykey
    data
    text
    <p>I want to send html email's with my Rails Mailer. Could be <code>multipart/alternative</code> or only <code>text/html</code>. Problem is, when I send an email with a link, it appears well on Gmail, but not so good in Thunderbird.</p> <p>The problem is, that in Thunderbird, the link is 'not clickable' - it's highlighted like a link, but clicking on it does nothing.</p> <p>Links on other mails (not sent from Rails Mailer) work flawlessly.</p> <p>So my question is: how to properly send an html email, so it will be viewed properly?</p> <p><strong>Mailer code:</strong></p> <pre class="lang-rb prettyprint-override"><code>class MyMailer &lt; ActionMailer::Base def mailing_delivery(email, subject) mail(:to =&gt; email, :subject =&gt; subject) end </code></pre> <p><strong>Mail view:</strong></p> <pre><code># mailing_delivery.html.haml %p Thanks! Its your mailer! %p = link_to "Google", "google.com" </code></pre> <p><strong>Source of email</strong> <em>(some parts cut-out)<strong></em>:</strong></p> <pre><code>Date: Thu, 18 Aug 2011 14:32:34 +0200 From: xxx To: xxx Message-ID: &lt;4e4d0662bf96e_41024be957a57974@xxx.mail&gt; Subject: Super news! Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-O2-Trust: 2, 64 X-O2-SPF: neutral &lt;p&gt; Thanks! It's your mailer! &lt;/p&gt; &lt;p&gt; &lt;a href="google.com"&gt;Google&lt;/a&gt; &lt;/p&gt; </code></pre> <p>Of course Rails 3. Thunderbird 5.0, but that's not the issue - because somehow other mails show up good.. And I don't think it's app specific.</p> <p>What should I do, to make this work?</p> <p><strong>Edit:</strong> I tried to change the 'content-transfer-encoding' header with no success, by doing <code>mail(:to =&gt; email, :subject =&gt; subject, "Content-Transfer-Encoding" =&gt; value)</code> or in class <code>default "Content-Transfer-Encoding" =&gt; value</code> with no luck.. how to change that?</p> <p>Emails that works good under Thunderbird have <code>Content-Transfer-Encoding: quoted-printable</code> (or eventually <code>base64</code>) so maybe that's the issue? How do I change it?</p> <p><strong>Edit 2:</strong> I managed to change the <code>Content-Transfer-Encoding</code> to <code>quoted-printable</code> but it's cutting the content, like this:</p> <pre><code>Date: Thu, 18 Aug 2011 22:04:21 +0200 From: xxx To: xxx Message-ID: &lt;4e4d704557839_151c4e4957c2132e@xxx.mail&gt; Subject: Super news! Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-O2-Trust: 2, 63 X-O2-SPF: neutral &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://ww= w.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;body&gt; &lt;p&gt; Thanks! It's your mailer! &lt;/p&gt; &lt;p&gt; &lt;a href= </code></pre> <p>One other thing: why is there a newline in <code>Content-Type</code> ? I didn't see it in other (working good) mails. How I can get rid of it?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload