Wraps PEAR's Mail and Mail_mime packages.
Provides a little extra functionality.
Requires PEAR mail and mail_mime (if you want to add attachements) packages installed.
Can send single attachements and plain text or html/plain
mails. This functionality is automatic dependant on what content
has been added to the mail before send.
| package | dstruct_common |
|---|
__construct()
attach(string $file, string $mime)
stringPath and name of the file
stringFile's mime-type
clear(string $clearcredentials)
If $clearcredentials is true then will also reset the credentials to the defaults (will use the ones if set in Prefs) and the replyto field.
stringReset credentials to defaults
getBody() : string
stringgetFrom() : string
stringgetHost() : string
stringgetJavascriptRedirect() : boolean
getPort() : integer
Port would usually be 25, but many ISPs and companies use other ports for authenticated emails. This allows sending from outside the 'trusted hosts' if credentials are provided.
integergetRedirect() : string
stringgetReplyTo() : string
stringgetSubject() : string
stringgetTo() : string
stringgetUserName() : string
stringsend() : boolean
N.B. Also attempts to redirect user depending on vars $redirectlocation
and SMTPEmail::$javascriptredirect.
Automatically selects plain text or mime email depending on what
content or attachements have been added.
booleansetBody(string $body)
string
setBodyHTML(string $html)
string
setFrom(string $from)
string
setHost(string $host)
mail0.conceptia.co.uk
string
setJavascriptRedirect(boolean $javascriptredirect)
True echos a javascript window.location call to the browser. False uses a PHP header() call, which is the default.
boolean
setPassword(string $password)
string
setPort(integer $port)
Port would usually be 25, but many ISPs and companies use other ports for authenticated emails. This allows sending from outside the 'trusted hosts' if credentials are provided.
integer
setRecipient(string $to)
string
setRedirect(string $redirectlocation)
WARNING: Be careful with this setting as it is echoed straight out to the browser and under certain circumstances could be a security hole. This method does no checking on the validity or security of the input so you must do this in your script.
string
setReplyTo(string $replyto)
string
setSubject(string $subject)
string
setTo(string $to)
string
setUserName(string $username)
string
setDefaultCredentials()
$body : string
$bodyhtml : string
$from : string
$host : string
$javascriptredirect : boolean
If set to false, uses header() to redirect to the redirect location. If set to true, echos a javascript block with a window.location call
$port : \inteter
$redirectlocation : string
$replyto : string
$subject : string
$to : string
$username : string