acs_mail_lite::send (public)
acs_mail_lite::send [ -send_immediately ] [ -valid_email ] \ -to_addr to_addr -from_addr from_addr [ -subject subject ] \ -body body [ -mime_type mime_type ] [ -cc_addr cc_addr ] \ [ -bcc_addr bcc_addr ] [ -reply_to reply_to ] \ [ -package_id package_id ] [ -no_callback ] [ -file_ids file_ids ] \ [ -filesystem_files filesystem_files ] \ [ -delete_filesystem_files ] [ -extraheaders extraheaders ] \ [ -use_sender ] [ -object_id object_id ]
Defined in packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl
Prepare an email to be sent. Various email attributes can be specified, such as subject, body, senders, recipients, attachments and so on. The proc relies on MIME and SMTP.
- Switches:
- -send_immediately (optional, boolean)
- The email is send immediately and not stored in the acs_mail_lite_queue
- -valid_email (optional, boolean)
- -to_addr (required)
- List of e-mail addresses to send this mail to.
- -from_addr (required)
- E-Mail address of the sender.
- -subject (optional)
- of the email
- -body (required)
- Text body of the email
- -mime_type (optional, defaults to
"text/plain"
)- MIME Type of the mail to send out. Can be "text/plain", "text/html".
- -cc_addr (optional)
- List of CC Users e-mail addresses to send this mail to.
- -bcc_addr (optional)
- List of CC Users e-mail addresses to send this mail to.
- -reply_to (optional)
- -package_id (optional)
- Package ID of the sending package
- -no_callback (optional, boolean)
- Boolean that indicates if callback should be executed or not. If you don't provide it it will execute callbacks
- -file_ids (optional)
- List of file ids (items or revisions) to be sent as attachments. This will only work with files stored in the file-storage.
- -filesystem_files (optional)
- List of regular files on the filesystem to be sent as attachments.
- -delete_filesystem_files (optional, boolean)
- -extraheaders (optional)
- List of keywords and their values passed in for headers. Interesting ones are: "Precedence: list" to disable autoreplies and mark this as a list message. This is as list of lists !!
- -use_sender (optional, boolean)
- Boolean indicating that from_addr should be used regardless of fixed-sender parameter
- -object_id (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- email_send
Source code: # # Check, if send_immediately is set if not, take global # parameter. # if { !$send_immediately_p } { set send_immediately_p [parameter::get -package_id [get_package_id] -parameter "send_immediately" -default 0] } # # If send_immediately_p true, then start # acs_mail_lite::send_immediately, so mail is not stored in # the db before delivery. # if { $send_immediately_p } { acs_mail_lite::send_immediately -to_addr $to_addr -cc_addr $cc_addr -bcc_addr $bcc_addr -from_addr $from_addr -reply_to $reply_to -subject $subject -body $body -package_id $package_id -file_ids $file_ids -filesystem_files $filesystem_files -delete_filesystem_files_p $delete_filesystem_files_p -mime_type $mime_type -no_callback_p $no_callback_p -extraheaders $extraheaders -use_sender_p $use_sender_p -object_id $object_id } else { # else, store it in the db and let the sweeper deliver the mail set creation_date [clock format [clock seconds] -format "%Y.%m.%d %H:%M:%S"] set locking_server "" db_dml create_queue_entry {} }Generic XQL file: packages/acs-mail-lite/tcl/acs-mail-lite-procs.xql
PostgreSQL XQL file: <fullquery name="acs_mail_lite::send.create_queue_entry"> <querytext> insert into acs_mail_lite_queue (message_id, creation_date, locking_server, to_addr, cc_addr, bcc_addr, from_addr, reply_to, subject, body, package_id, file_ids, filesystem_files, delete_filesystem_files_p, mime_type, no_callback_p, extraheaders, use_sender_p, object_id ) values (nextval('acs_mail_lite_id_seq'), :creation_date, :locking_server, :to_addr, :cc_addr, :bcc_addr, :from_addr, :reply_to, :subject, :body, :package_id, :file_ids, :filesystem_files, (case when :delete_filesystem_files_p = '1' then TRUE else FALSE end), :mime_type, (case when :no_callback_p = '1' then TRUE else FALSE end), :extraheaders, (case when :use_sender_p = '1' then TRUE else FALSE end), :object_id ) </querytext> </fullquery>packages/acs-mail-lite/tcl/acs-mail-lite-procs-postgresql.xql
Oracle XQL file: <fullquery name="acs_mail_lite::send.create_queue_entry"> <querytext> insert into acs_mail_lite_queue (message_id, creation_date, locking_server, to_addr, from_addr, reply_to, subject, package_id, file_ids, filesystem_files, delete_filesystem_files_p, mime_type, no_callback_p, use_sender_p, cc_addr, bcc_addr, body, extraheaders, object_id ) values (acs_mail_lite_id_seq.nextval, :creation_date, :locking_server, :to_addr, :from_addr, :reply_to, :subject, :package_id, :file_ids, :filesystem_files, decode(:delete_filesystem_files_p,'1','t','f'),, :mime_type, decode(:no_callback_p,'1','t','f'), decode(:use_sender_p,'1','t','f'), :cc_addr, :bcc_addr, :body, :extraheaders, :object_id ) </querytext> </fullquery>packages/acs-mail-lite/tcl/acs-mail-lite-procs-oracle.xql