Updated NOTIFICATION_SMTP_MAILER to follow the EiffelNet EMAIL design.
This commit is contained in:
@@ -95,17 +95,42 @@ feature -- Basic operation
|
|||||||
l_email: EMAIL
|
l_email: EMAIL
|
||||||
h: STRING
|
h: STRING
|
||||||
i: INTEGER
|
i: INTEGER
|
||||||
|
lst: LIST [READABLE_STRING_8]
|
||||||
do
|
do
|
||||||
create l_email.make_with_entry (a_email.from_address, addresses_to_header_line_value (a_email.to_addresses))
|
lst := a_email.to_addresses
|
||||||
|
if lst.is_empty then
|
||||||
|
-- Error ...
|
||||||
|
else
|
||||||
|
-- With EMAIL, there should be a unique recipient at creation.
|
||||||
|
create l_email.make_with_entry (a_email.from_address, lst.first)
|
||||||
|
if lst.count > 1 then
|
||||||
|
from
|
||||||
|
lst.start
|
||||||
|
lst.forth
|
||||||
|
until
|
||||||
|
lst.off
|
||||||
|
loop
|
||||||
|
l_email.add_recipient_address (lst.item)
|
||||||
|
lst.forth
|
||||||
|
end
|
||||||
|
end
|
||||||
if attached a_email.reply_to_address as l_reply_to then
|
if attached a_email.reply_to_address as l_reply_to then
|
||||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_reply_to, l_reply_to)
|
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_reply_to, l_reply_to)
|
||||||
end
|
end
|
||||||
|
|
||||||
if attached a_email.cc_addresses as lst then
|
if attached a_email.cc_addresses as l_cc_addresses then
|
||||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_cc, addresses_to_header_line_value (lst))
|
across
|
||||||
|
l_cc_addresses as ic
|
||||||
|
loop
|
||||||
|
l_email.add_recipient_address_in_cc (ic.item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if attached a_email.bcc_addresses as l_bcc_addresses then
|
||||||
|
across
|
||||||
|
l_bcc_addresses as ic
|
||||||
|
loop
|
||||||
|
l_email.add_recipient_address_in_bcc (ic.item)
|
||||||
end
|
end
|
||||||
if attached a_email.bcc_addresses as lst then
|
|
||||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.h_bcc, addresses_to_header_line_value (lst))
|
|
||||||
end
|
end
|
||||||
l_email.set_message (a_email.content)
|
l_email.set_message (a_email.content)
|
||||||
l_email.add_header_entry ({EMAIL_CONSTANTS}.H_subject, a_email.subject)
|
l_email.add_header_entry ({EMAIL_CONSTANTS}.H_subject, a_email.subject)
|
||||||
@@ -114,9 +139,9 @@ feature -- Basic operation
|
|||||||
;(create {HTTP_DATE}.make_from_date_time (a_email.date)).append_to_rfc1123_string (h)
|
;(create {HTTP_DATE}.make_from_date_time (a_email.date)).append_to_rfc1123_string (h)
|
||||||
l_email.add_header_entry ("Date", h)
|
l_email.add_header_entry ("Date", h)
|
||||||
|
|
||||||
if attached a_email.additional_header_lines as lst then
|
if attached a_email.additional_header_lines as l_lines then
|
||||||
across
|
across
|
||||||
lst as ic
|
l_lines as ic
|
||||||
loop
|
loop
|
||||||
h := ic.item
|
h := ic.item
|
||||||
i := h.index_of (':', 1)
|
i := h.index_of (':', 1)
|
||||||
@@ -129,6 +154,8 @@ feature -- Basic operation
|
|||||||
end
|
end
|
||||||
|
|
||||||
smtp_send_email (l_email)
|
smtp_send_email (l_email)
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
@@ -182,4 +209,3 @@ note
|
|||||||
Customer support http://support.eiffel.com
|
Customer support http://support.eiffel.com
|
||||||
]"
|
]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user