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)
string
Path and name of the file
string
File'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.
string
Reset credentials to defaults
getBody() : string
string
getFrom() : string
string
getHost() : string
string
getJavascriptRedirect() : 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.
integer
getRedirect() : string
string
getReplyTo() : string
string
getSubject() : string
string
getTo() : string
string
getUserName() : string
string
send() : 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.
boolean
setBody(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