Forum: Ruby How to send mail with High priority

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sandy (Guest)
on 2008-11-04 05:12
(Received via mailing list)
Hi all

     I try to send mail by net::smtp. it works fine.
    But I don't know how to send high priority mails.
    who can help me for this ?
    thanks

sandy
Heesob P. (Guest)
on 2008-11-04 06:55
(Received via mailing list)
Hi,

2008/11/4 Sandy <removed_email_address@domain.invalid>:
> Hi all
>
>     I try to send mail by net::smtp. it works fine.
>    But I don't know how to send high priority mails.
>    who can help me for this ?
>    thanks
>
> sandy
>
>
Add Priority: Urgent and Importance: High headers like this:

Net::SMTP.start('smtp.example.com', 25) do |smtp|
  smtp.open_message_stream('removed_email_address@domain.invalid', 
['removed_email_address@domain.invalid']) do
|f|
    f.puts 'Priority: Urgent'
    f.puts 'Importance: High'
    f.puts 'From: removed_email_address@domain.invalid'
    f.puts 'To: removed_email_address@domain.invalid'
    f.puts 'Subject: test message'
    f.puts
    f.puts 'This is a test message.'
  end
end

Hope this helps
Park H.
Brian C. (Guest)
on 2008-11-04 10:39
Heesob P. wrote:
> Add Priority: Urgent and Importance: High headers like this:

Which are, of course, ignored by virtually every MTA on the planet,
since RFC 2822 does not define these headers, nor the way they should be
handled.

However they might be highlighted with a flag in the receiver's MUA
though, depending on what MUA they use, and perhaps that's all you want.

There's a list of non-standard or experimental headers you can try in
RFC 2076 (see esp. section 3.9)
This topic is locked and can not be replied to.