Forum: Ruby gmailer

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Beada4200408a4bfa7750b4c84e518d4?d=identicon&s=25 unni.tallman (Guest)
on 2007-02-16 14:01
(Received via mailing list)
How can i send HTML emails using the ruby gmailer module?
7b4707f974af261f71943e1f2046c9ee?d=identicon&s=25 SonOfLilit (Guest)
on 2007-02-17 14:08
(Received via mailing list)
There are a few aspects to it:

This is were the question belongs:

This is about the pitfalls of how popular email clients read HTML and
therefore how you should write HTML that would display correctly.

Markaby is a great way to generate HTML, although you might want to
try what Ara announced yesterday (xx I think) which is claimed to be
more powerful.

This is an example of how to send email with Gmailer:
   GMailer.connect(name, pwd) do |g|
      # 'From' default account
        :to => ",,",
        :cc => "",
        :subject => "Hello There!",
        :body => "Hi...\n\nBlah blah blah~...",
        :files => ["./my_pic.jpg", "./my_cv.txt"])

      # multiple verified email addresses and choose one 'From:' email
        :from => "",
        :to => ",,",
        :cc => "",
        :subject => "Hello There!",
        :body => "Hi...\n\nBlah blah blah~...",
        :files => ["./my_pic.jpg", "./my_cv.txt"])

(taken form gmailer readme).

This helps you with MIME handling so you can compose a MIME message

I think you can just stick the MIME message's .to_s as :body for
Gmailer#send. Experiment with it.

In case you don't know about MIME and HTML email, well... All you need
to do is have a content-type of text/html for the message body.

Google further.

I also advise you to have a look at the adopt-a-newbie project here at
the ML.

Aur Saraf
D977ee778a175c2de249015669c7228b?d=identicon&s=25 Jason Palmer (Guest)
on 2007-02-17 16:08
(Received via mailing list)
Might want to give mailfactory a try
This topic is locked and can not be replied to.