Ruby

Ruby allows you to simply send emails through an SMTP library: mail

To install mail, we will use gem.

1
gem install mail

You can now use the library in your application. Here is a code example that you can adapt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
  * File Name : send.rb
  * Task : send email through Tipimail
 */
 
require 'mail'
 
Mail.defaults do
    delivery_method :smtp, {
        :port      => 587,
        :address   => "smtp.tipimail.com",
        :user_name => "username",
        :password  => "password"
    }
end
 
mail = Mail.deliver do
    from    'contact@mail.tipimail.com'
    to      'to@mail.tipimail.com'
    subject 'sujet de votre email'
 
    text_part do
        body 'Message au format texte'
    end
 
    html_part do
        content_type 'text/html; charset=UTF-8'
        body 'Message au format html'
    end
end

Call the script

1
ruby send.rb