⧼vector-jumptocontent⧽

API:EPrints/Email: Difference between revisions

From EPrints Documentation
Cjg (talk | contribs)
No edit summary
No edit summary
Line 10: Line 10:
'''EPrints::Email''' - Email Utility functions for EPrints.
'''EPrints::Email''' - Email Utility functions for EPrints.


<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<h4><span style='display:none'>User Comments</span></h4>
<!-- Edit below this comment -->
<!-- Pod2Wiki=head_synopsis --></div>
==SYNOPSIS==
  use EPrints;
 
  # sends an email to Bob Test at test@test.com in English with the
  # subject "Recent Test Reports"
  EPrints::Email::send_mail(
      handle =&gt; $handle,
      langid =&gt; "en",
    to_email =&gt; "test@test.com",
    to_name =&gt; "Bob Test",
    subject =&gt; "Recent Test Reports",
    message =&gt; $message_dom,
  );
 
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<h4><span style='display:none'>User Comments</span></h4>
<h4><span style='display:none'>User Comments</span></h4>
Line 45: Line 25:


<!-- Pod2Wiki=item_send_mail --></div>
<!-- Pod2Wiki=item_send_mail --></div>
===EPrints::Email::send_mail( %properties )===
===EPrints::Utils::send_mail( %properties )===


Sends an email.  
Sends an email.  
Required properties:
session - the current session
langid - the id of the language to send the email in.
to_email, to_name - who to send it to
subject - the subject of the message (UTF-8 encoded string)
message - the body of the message as a DOM tree
optional properties:
from_email, from_name - who is sending the email (defaults to the archive admin)
sig - the signature file as a DOM tree
replyto_email, replyto_name
attach - ref to an array of filenames (with full paths) to attach to the message
Returns true if mail sending (appears to have) succeeded. False otherwise.
Uses the config. option "send_email" to send the mail, or if that's not defined sends the email via STMP.
names and the subject should be encoded as utf-8


<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>

Revision as of 16:34, 12 February 2010


Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Email - Email Utility functions for EPrints.

User Comments


DESCRIPTION

This package handles sending emails.

User Comments


EPrints::Utils::send_mail( %properties )

Sends an email.

Required properties:

session - the current session

langid - the id of the language to send the email in.

to_email, to_name - who to send it to

subject - the subject of the message (UTF-8 encoded string)

message - the body of the message as a DOM tree

optional properties:

from_email, from_name - who is sending the email (defaults to the archive admin)

sig - the signature file as a DOM tree

replyto_email, replyto_name

attach - ref to an array of filenames (with full paths) to attach to the message

Returns true if mail sending (appears to have) succeeded. False otherwise.

Uses the config. option "send_email" to send the mail, or if that's not defined sends the email via STMP.

names and the subject should be encoded as utf-8


User Comments