|
|
|
File: C:/usr/local/lib/php/blueshoes-4.2/core/net/email/Bs_Smtp.class.php
BlueShoes Application Framework - net/email
Bs_Smtp
Bs_Object | +-- Bs_NetApplication | +-- Bs_Smtp
SMTP class.
|
SMTP class.
class to send out email using an existing email server.smtp = Simple Mail Transfer Protocol.features:- to, cc, bcc, reply-to, client string, from, sender, subject, origdate, and many more header vars.- custom header lines.- reports failed receivers, reports new addresses if server gave them.missing:- authentication- attachments- pgp supportMIME-Version: 1.0Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C13BF5.289982E0"X-Mailer: Microsoft Outlook, Build 10.0.2616X-Message-Flag: Bitte um AntwortX-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000Content-Type: TEXT/PLAIN; CHARSET=US-ASCIIContent-Transfer-Encoding: 7BITMIME-Version: 1.0 (WebTV)Mime-Version: 1.0Content-Type: multipart/alternative;boundary="----=_NextPart_000_0004_01BD9316.430F9460"X-Priority: 3X-Msmail-Priority: NormalX-Mailer: Microsoft Outlook Express 4.72.2106.4X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4From richard.chamberlain@diamond.co.uk Mon Jun 08 20:45:28 1998Received: from mars.cableol.net (mars.cableol.net [194.168.4.224])by asteroid.immoworld.ch (2.5 Build 2630 (Berkeley 8.8.6)/8.8.4) with SMTPid UAA00226 for <peg@albundy.com>; Mon, 08 Jun 1998 20:45:24 +0200Received: from [194.168.80.90] by mars.cableol.net; (5.65v3.2/1.1.8.2/22Feb96-0403PM)id AA01082; Mon, 8 Jun 1998 19:44:42 +0100Message-Id: <000701bd930d$e37cb260a50a8c2@richard.chamberlain>From: "Richard Chamberlain" <richard.chamberlain@diamond.co.uk>To: <peg@albundy.com>Subject: Oh, Peggy, Please!Date: Mon, 8 Jun 1998 19:47:25 +0100Mime-Version: 1.0Content-Type: multipart/alternative;boundary="----=_NextPart_000_0004_01BD9316.430F9460"X-Priority: 3X-Msmail-Priority: NormalX-Mailer: Microsoft Outlook Express 4.72.2106.4X-Mimeole: Produced By Microsoft MimeOLE V4.72.2106.4This is a multi-part message in MIME format.------=_NextPart_000_0004_01BD9316.430F9460Content-Type: text/plain;charset="iso-8859-1"Content-Transfer-Encoding: quoted-printablePeggy!You are my absolute heroine!Never let a man win. Keep the good work up and the bad man down.Love and vengence,Sue PinderNottingham, UK.------=_NextPart_000_0004_01BD9316.430F9460Content-Type: text/html;charset="iso-8859-1"Content-Transfer-Encoding: quoted-printable<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"><HTML><HEAD><META content=3Dtext/html;charset=3Diso-8859-1 =http-equiv=3DContent-Type><META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR></HEAD><BODY bgColor=3D#ffffff><DIV><FONT color=3D#000000 size=3D2>Peggy!</FONT></DIV><DIV><FONT color=3D#000000 size=3D2></FONT> </DIV><DIV><FONT size=3D2>You are my absolute heroine!</FONT></DIV><DIV><FONT size=3D2>Never let a man win. Keep the good work up and =the bad=20man down.</FONT></DIV><DIV><FONT size=3D2></FONT> </DIV><DIV><FONT size=3D2>Love and vengence,</FONT></DIV><DIV><FONT size=3D2></FONT> </DIV><DIV><FONT size=3D2>Sue Pinder</FONT></DIV><DIV><FONT size=3D2>Nottingham, UK.</FONT></DIV></BODY></HTML>------=_NextPart_000_0004_01BD9316.430F9460--Content-Type: multipart/alternative; boundary="----=_NextPart_000_0011_01C13189.DDD21DA0"example usage:$mail =& new Bs_Smtp();$mail->host = 'your.mailserver.com';$mail->addFrom('from@blueshoes.org', 'from';$mail->addTo('la@la.com', 'la la');$mail->subject = 'hello world';$mail->message = 'foobar';$status = $mail->send();warning:if you want to send out more than 1 email, you need to call $mail->reset() before setting the params for the 2nd mail.if you forget that, you really screw up things and the email goes to ppl that it should not.dependencies: Net/Bs_NetApplication (which uses Net/Bs_SocketClient and Net/Bs_Url)if you're looking for information about the smtp protocol, try these, have fun :)SIMPLE MAIL TRANSFER PROTOCOLRFC 2821 - http://www.faqs.org/rfcs/rfc2821.htmlRFC 1869RFC 974RFC 821 - ftp://ftp.isi.edu/in-notes/std/std10.txt (yes it's from 1982)Additional Documents:Internet Message Format (headers and the like) - RFC 2822 - http://www.faqs.org/rfcs/rfc2822.htmlService Extensions:AUTH - Authentication - http://www.faqs.org/rfcs/rfc2554.htmlPIPELINING - Command Pipelining - http://www.faqs.org/rfcs/rfc2920.htmlCHUNKING - Transmission of Large and Binary MIME Messages - http://www.faqs.org/rfcs/rfc3030.htmlthere are many more. about 20 total or so, i think.i think the rfc and its examples are not that easy to understand. at least i had a few problems...let's look at the following example which i took from rfc2821 D.1 (A Typical SMTP Transaction Scenario).i had to extend it a bit. rfc2822 part 3.6. specifies that the header fields 'orig-date' (date) and 'from'are mandatory, but then the example here did not make use of *any* header fields. but when i send out amail without any header fields, someone (must be the email server) adds the 2 mandatory fields.S: 220 foo.com Simple Mail Transfer Service ReadyC: EHLO bar.comS: 250-foo.com greets bar.comS: 250-8BITMIMES: 250-SIZES: 250-DSNS: 250 HELPC: MAIL FROM:<Smith@bar.com>S: 250 OKC: RCPT TO:<Jones@foo.com>S: 250 OKC: RCPT TO:<Green@foo.com>S: 550 No such user hereC: RCPT TO:<Brown@foo.com>S: 250 OKC: DATAS: 354 Start mail input; end with <CRLF>.<CRLF>C: From: frommm <from@blueshoes.org>C: To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>C: Date: Fri, 21 Nov 2001 09:55:06 -0600C: Blah blah blah...C: ...etc. etc. etc.C: .S: 250 OKC: QUITS: 221 foo.com Service closing transmission channelin smtp the 'header' is inside the 'data' (body) part. the http protocol works a bit different.there the header comes first, is terminated with an empty line, and then comes the body. in therfc, the example above had no header lines at all (already said). and the best, it had an emptyline before the DATA command. so i thought it would be the same. but the empty line in the rfcis there because it is in some printable format. took me a while to figure out how it finallyworks.license:whatever the license of this class is: it is absolutely forbidden to use/abuse it to send out unsolicitedemails (aka spam).
| Authors | |
| Version | 4.0.$id$ |
| Copyright | blueshoes.org |
|
| |
|
|
|
Methods inherited from Bs_Object |
| isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean |
|
|
|
Private Method Summary |
| void |
addCc( $email, string $name) |
| void |
addBcc( $email, string $name) |
| void |
addFrom( $email, string $name) |
| void |
addReplyTo( $email, string $name) |
| array |
send()sends out the email. |
| bool |
_sendEhlo()send the EHLO command to the server. |
| bool |
_sendHelo()send the HELO command to the server. |
| bool |
_sendMail()sends the mail from command. |
| array |
_sendRcpt()sends the Rcpt (recepient) commands for all To's, Cc's and Bcc's. |
| array |
_sendRcptHelperArrays(string &$array)helper method for _sendRcpt(). |
| array |
_sendRcptHelperNetwork(string $forwardPath)helper method for _sendRcpt(). |
| bool |
_sendData()sends the body of the email message. |
| bool |
_sendQuit()sends the quit command. |
| bool |
_connect()Overwrites the parent method, but still makes use of it. |
| void |
_disconnect()Overwrites the parent method, but still makes use of it. |
| bool |
_authenticate()do smtp authentication. |
| string |
_prepareAddressList(array &$array)prepares an email header list like To: Cc: Bcc: |
| string |
_prepareHeader()prepares the header for the email. |
| void |
&_raiseError([ string $code, string $nativeCode, string $msg, string $file, string $line, string $weight ])This method is called to generate an error. |
| void |
attach()Warning: documentation is missing. |
| void |
PrepareData( $data, &$output)Warning: documentation is missing. |
| void |
_sendRset()Warning: documentation is missing. |
| void |
_sendNoop()Warning: documentation is missing. |
| void |
_sendVrfy()Warning: documentation is missing. |
|
|
|
Public Field Summary |
| string |
$localhostThe domain name as which we identify ourself to the mailserver. |
| string |
$subjectthe subject field is not mandatory (rfc). |
| string |
$messagethe so called body of the email message. |
|
Private Field Summary |
| string |
$hostoverwrite default value. |
| integer |
$portoverwrite default value. |
| string |
$clientthe mailclient name and version. |
| string |
$authenticateif we should log in (authenticate) to the mailserver. |
| string |
$username |
| string |
$password |
| array |
$esmtpstores detected features of the smtp server. |
| array |
$_fromthe senders addresses. mandatory. |
| string |
$senderi don't think you'll ever need this one. |
| array |
$_replyToemail addresses to where the receiving user should reply his answer email. |
| array |
$_tothe To: receiver(s) of the email. |
| array |
$_ccsee var $_to. |
| array |
$_bccsee var $_to. |
| string |
$_origDatethe orig-date header field is mandatory (rfc). if not set by the user, it |
| int |
$prioritythe email priority. |
| string |
$sensitivitythe email sensitivity. |
| array |
$_attachmentvector |
| array |
$_headerhash holding additional key/value pairs to attach to the mail header. |
| string |
$encoding |
| unknown |
$this |
|
|
|
Public Method Details |
Bs_Smtp |
|
public void Bs_Smtp( )
|
| |
Constructor
|
| Returns |
void |
|
addTo |
|
public void addTo( string $email, [ string $name ] )
|
| |
adds a receiver.
no validation on the email address is made; do it yourself.to make our life easier we don't accept a string with email and name here, wewant both values separated. the coder using this class has the information inseparated variables anyway.examples:addTo('info@blueshoes.org');addTo('info@blueshoes.org', 'blueshoes');if param $name is an empty string (or null), we don't send that information.
|
| Parameter |
|
|
|
| string |
$name |
= >>''<< |
|
default is '' |
|
| Returns |
void |
| See Also |
$_to |
|
setOrigDate |
|
public void setOrigDate( string $param )
|
| |
sets the origDate header value.
|
| Parameter |
|
|
| Returns |
void |
| See Also |
$this |
|
setHeader |
|
public void setHeader( string $key, string $value )
|
| |
sets a header to submit along with all the other stuff with the email.
the method is called 'set', there is no 'add' and 'remove'. so take careyourself if you overwrite a key. and if a value is set to NULL it won'tbe submitted.the key is taken as is, not changed to upper- or lowercase.if you set $key to NULL, $value is taken as both key and value.examples:setHeader('MIME-Version', '1.0'); //these 2 versions have the same end result.setHeader(NULL, 'MIME-Version: 1.0'); //but the first one is absolutely recommended.rfc2822: (section 2.2. following)the key must be in us-ascii range 33-126 (inclusive), except colon.the value can be any us-ascii, except CR and LF.
|
| Parameter |
|
|
|
|
| Returns |
void |
|
convertForOldies |
|
public string convertForOldies( string $string )
|
| |
convert a message text so that an old client can read
it all. all chars need to be <= ascii 127.
|
| Parameter |
|
|
| Returns |
string |
|
reset |
|
public void reset( )
|
| |
resets the vars so a new email session can be started.
does not close connections or reset connection information.
|
| Returns |
void |
|
|
Private Method Details |
addCc |
|
private void addCc( $email, string $name )
|
| |
|
| Parameter |
|
|
$email |
|
|
Warning: documentation is missing. |
|
|
| string |
$name |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
| See Also |
$this |
|
addBcc |
|
private void addBcc( $email, string $name )
|
| |
|
| Parameter |
|
|
$email |
|
|
Warning: documentation is missing. |
|
|
| string |
$name |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
| See Also |
$this |
|
addFrom |
|
private void addFrom( $email, string $name )
|
| |
|
| Parameter |
|
|
$email |
|
|
Warning: documentation is missing. |
|
|
| string |
$name |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
| See Also |
$this |
|
addReplyTo |
|
private void addReplyTo( $email, string $name )
|
| |
|
| Parameter |
|
|
$email |
|
|
Warning: documentation is missing. |
|
|
| string |
$name |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
| See Also |
$this |
|
send |
|
private array send( )
|
| |
sends out the email.
|
| Returns |
array (same as _sendRcptHelperArrays() so see there.) |
| Throws |
bs_exception |
|
_sendEhlo |
|
private bool _sendEhlo( )
|
| |
send the EHLO command to the server.
read extended server features (esmtp) and store them in $this->esmtp.see RFC 2821 4.1.1.1
|
| Returns |
bool TRUE |
| Throws |
bs_exception |
| See Also |
$this, $this |
|
_sendHelo |
|
private bool _sendHelo( )
|
| |
send the HELO command to the server.
this is the old RFC 821 equivalent to the new RFC 2821 EHLO command.
|
| Returns |
bool TRUE |
| Throws |
bs_exception |
| See Also |
$this |
|
_sendMail |
|
private bool _sendMail( )
|
| |
sends the mail from command.
example:MAIL FROM:<Smith@bar.com>
|
| Returns |
bool TRUE |
| Throws |
bs_exception |
|
_sendRcpt |
|
private array _sendRcpt( )
|
| |
sends the Rcpt (recepient) commands for all To's, Cc's and Bcc's.
|
| Returns |
array (same as _sendRcptHelperArrays() so see there.) |
| Throws |
bs_exception |
|
_sendRcptHelperArrays |
|
private array _sendRcptHelperArrays( string &$array )
|
| |
helper method for _sendRcpt().
this is some code. :)i had to move this to a separate method because of the code logic.return value: vector with 1 or 2 elements. 1st is a bool telling if the addresswas accepted. 2nd, if set, is the new email address to use now/in the future.return value:bs_exception if something went wrong with the network or so.array otherwise.array[0] = string ['all'|'some'|'none'|'empty'] (telling if all receivers were accepted. 'empty' means there were none while 'none' means all failed.).array[1] = array (hash, key = old addresses that failed, value = new addresses given by server that was used automatically successfully)array[2] = array (hash, key = old address that worked, value = new address to use next time given by server)
|
| Parameter |
|
| string |
&$array |
|
|
(email address) |
|
| Returns |
array (see above) |
| Throws |
bs_exception |
|
_sendRcptHelperNetwork |
|
private array _sendRcptHelperNetwork( string $forwardPath )
|
| |
helper method for _sendRcpt().
this is the network code.i had to move this to a separate method because of the code logic.return value: vector with 1 or 2 elements. 1st is a bool telling if the addresswas accepted. 2nd, if set, is the new email address to use now/in the future.
|
| Parameter |
|
| string |
$forwardPath |
|
|
(email address) |
|
| Returns |
array |
|
_sendData |
|
private bool _sendData( )
|
| |
sends the body of the email message.
|
| Returns |
bool TRUE |
| Throws |
bs_exception |
|
_sendQuit |
|
private bool _sendQuit( )
|
| |
sends the quit command.
|
| Returns |
bool TRUE |
| Throws |
bs_exception |
|
_connect |
|
private bool _connect( )
|
| |
Overwrites the parent method, but still makes use of it.
|
| Returns |
bool TRUE @trhows bs_exception |
|
_disconnect |
|
private void _disconnect( )
|
| |
Overwrites the parent method, but still makes use of it.
|
| Returns |
void |
|
_authenticate |
|
private bool _authenticate( )
|
| |
do smtp authentication.
as mentioned in the header of this file, see the auth rfc.also see http://www.iana.org/assignments/sasl-mechanismshrm. the 'AUTH LOGIN' mechanism using a user/pass looks like the easiest/best to me.but then it's non-standard, not-documented, non-rfc, and still it seems everybody isusing it. crap, can't find documentation for it.
|
| Returns |
bool TRUE on success (or if we are already logged in), FALSE on failure or if not supported or something. |
|
_prepareAddressList |
|
private string _prepareAddressList( array &$array )
|
| |
prepares an email header list like To: Cc: Bcc:
|
| Parameter |
|
| array |
&$array |
|
|
(vector holding vector) |
|
| Returns |
string (may be empty) |
|
_prepareHeader |
|
private string _prepareHeader( )
|
| |
prepares the header for the email.
|
| Returns |
string lines ) |
|
&_raiseError |
|
private void &_raiseError( [ string $code, string $nativeCode, string $msg, string $file, string $line, string $weight ] )
|
| |
This method is called to generate an error.
|
| Parameter |
|
| string |
$code |
= >>BS_EMAILVALIDATOR_ERROR,<< |
|
|
|
|
| string |
$nativeCode |
= >>NULL,<< |
|
|
|
|
|
|
| string |
$file |
= >>''<< |
|
(use __FILE__) |
|
|
| string |
$line |
= >>''<< |
|
(use __LINE__) |
|
|
| string |
$weight |
= >>''<< |
|
('fatal') |
|
| Returns |
void |
|
attach |
|
private void attach( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
PrepareData |
|
private void PrepareData( $data, &$output )
|
| |
Warning: documentation is missing.
|
| Parameter |
|
|
$data |
|
|
Warning: documentation is missing. |
|
|
|
&$output |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
_sendRset |
|
private void _sendRset( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
_sendNoop |
|
private void _sendNoop( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
_sendVrfy |
|
private void _sendVrfy( )
|
| |
Warning: documentation is missing.
|
| Returns |
void |
|
|
Public Field Details |
$localhost |
|
public string $localhost
>><<
The domain name as which we identify ourself to the mailserver.
i'm not sure if the receiving mailserver does anything with it, eg compares itwith our real ip/host address. but the mailserver sees our ip anyway, so whynot send the same information here.
|
|
$subject |
|
public string $subject
>><<
the subject field is not mandatory (rfc).
|
|
$message |
|
public string $message
>><<
the so called body of the email message.
rfc2822 section 2.3:- CR and LF MUST only occur together as CRLF; they MUST NOT appearindependently in the body.- Lines of characters in the body MUST be limited to 998 characters,and SHOULD be limited to 78 characters, excluding the CRLF.
|
|
|
Private Field Details |
$host |
|
private string $host
>>'localhost'<<
overwrite default value.
|
|
$port |
|
private integer $port
>>25<<
overwrite default value.
|
|
$client |
|
private string $client
>>'BlueShoes Mail 4.0'<<
the mailclient name and version.
will be sent as a header line like:X-Mailer: BlueShoes Mail 4.0
|
|
$authenticate |
|
private string $authenticate
>>FALSE<<
if we should log in (authenticate) to the mailserver.
|
| See Also |
$username, $password |
|
$username |
|
private string $username
>><<
|
| See Also |
$authenticate, $password |
|
$password |
|
private string $password
>><<
|
| See Also |
$authenticate, $username |
|
$esmtp |
|
private array $esmtp
>><<
stores detected features of the smtp server.
hash holding vector 0-n elements.hash key = ehlo-keyword, vector elements = ehlo-params.all ehlo-keyword and ehlo-params values are stored in uppercase to makeout life easier. i believe that most servers send them uppercase anyway,but the rfc specifies that any case must be accepted.
|
|
$_from |
|
private array $_from
>><<
the senders addresses. mandatory.
used for both, the from header line and mail from command.see var $_to, but not the advanced data structure part of course.example header line:From: frommm <from@blueshoes.org>From: from1 <from1@blueshoes.org>, from2 <from2@blueshoes.org>example MAIL command line:MAIL FROM: <from@blueshoes.org>only the first mail address is used here.there can be 1-n addresses. if there is more than one, $sender becomes mandatory.
|
| See Also |
addFrom(), $sender, $_to |
|
$sender |
|
private string $sender
>><<
i don't think you'll ever need this one.
for example if a secretary sends an email for her boss, the sender isthe secretary's email address while the from is the chef's one.it is mandatory if $from is a list of addresses. see rfc2822 section 3.6.2.but the mailserver i'm testing with (mail.swissonline.ch) does not complain.so what we do is: if $_from is a list and $sender is not set, we use the firstaddress from $_from as the $sender address. just as we do it for the MAIL FROMcommand.example header line:Sender: senderrr <sender@blueshoes.org>
|
| See Also |
$sender |
|
$_replyTo |
|
private array $_replyTo
>><<
email addresses to where the receiving user should reply his answer email.
see var $_to, but not the advanced data structure part of course.adds the Reply-To: header line. example://Reply-To: <answers@blueshoes.org>
|
| See Also |
$this, $_to |
|
$_to |
|
private array $_to
>><<
the To: receiver(s) of the email.
used for both, the to header line and rcpt to command.rfc2822 sections 3.6.3. and 3.4. and 3.4.1.examples for valid TO: header lines:To: "Joe Q. Public" <john.q.public@example.com>To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>To: <boss@nil.test>, "Giant; \"Big\" Box" <sysservices@example.net>To: A Group:Chris Jones <c@a.test>,joe@where.test,John <jdoe@one.test>;to me it looks not that easy to be rfc compliant here.example RCPT command line:RCPT TO: <to@blueshoes.org>there is only one address per rcpt-to command, and it must be in <> tags.DATA STRUCTUREthe data structure of this var is a bit complicated. here we go with an example:when you add an address using $this->addTo(), the data array looks like this:$_to[]['email'] = 'info@blue-shoes.com'; //email address$_to[]['caption'] = 'info at blueshoes'; //textual nameso for the first addTo() it is $_to[0], then $_to[1] and so on, but we don't lookat this here. we only play with one address in this example.once the email was sent using $this->send(), you might get a bs_exception back. thismeans that no mail was sent at all, and thus this var is of no use for you anymore.if you got no exception, then it must be a bool TRUE or FALSE return value. thefollowing one OR two elements are added to each address entry in the array, dependingon what happened:$_to[]['status'] = FALSE; //bool TRUE or FALSE. tells if the address in [0] (info@blue-shoes.com)//was accepted or not.$_to[]['sub']['email'] = 'admin@blueshoes.org'; //in this case it was not accepted. in rfc lingo we got a 551 reply. the//server knew the users new email address and gave it to us. if the server//just sends a 550 (no valid address) this 3rd element [3] is not here at all.$_to[]['sub']['status'] = TRUE; //because we have the new address, we automatically try to use it. this bool//value tells if the new address worked.$_to[]['sub']['sub']['email'] = 'info@blueshoes.org'; //if there is a new address for the new address (think about it) then we have//it here. so here goes the recursive loop. max recursive calls is a hardcoded 5.//if an address is seen twice (ping-pong) then we stop immediatly.here is a longer example with more addresses:$_to[0]['email'] = 'info@blue-shoes.com';$_to[0]['caption'] = 'info at blueshoes';$_to[0]['status'] = TRUE; //everything ok.$_to[1]['email'] = 'webmaster@blue-shoes.com';$_to[1]['caption'] = ''; //no textual name, only email address available.$_to[1]['status'] = TRUE;$_to[1]['sub']['email'] = 'webmaster@blue-shoes.com'; //the address was accepted, but in the future we should use this address (251).$_to[2]['email'] = 'some_user@blue-shoes.com';$_to[2]['caption'] = 'some user';$_to[2]['status'] = FALSE; //not accepted, and we don't know what to do (550).$_to[3]['email'] = 'karen-smith@blue-shoes.com';$_to[3]['caption'] = 'karen smith';$_to[3]['status'] = FALSE; //not accepted, but server knows her new address (551).$_to[3]['sub']['email'] = 'karen-thomson@blue-shoes.com'; //she's married now... bad luck :-)$_to[3]['sub']['status'] = TRUE; //new address worked...$_to[3]['sub']['sub']['email'] = 'karen-thomson@blueshoes.org'; //...but server has a newer address again. domain name changed. (251)
|
| See Also |
$this |
|
$_cc |
|
private array $_cc
>><<
see var $_to.
|
| See Also |
$this, $_to |
|
$_bcc |
|
private array $_bcc
>><<
see var $_to.
|
| See Also |
$this, $_to |
|
$_origDate |
|
private string $_origDate
>><<
the orig-date header field is mandatory (rfc). if not set by the user, it
will be set by the application itself (current datetime).specification: rfc2822 section 3.3.example header line:Date: Fri, 21 Nov 1997 09:55:06 -0600
|
| See Also |
$this |
|
$priority |
|
private int $priority
>><<
the email priority.
only sent if it is set.number from 1 to 5 (including) where 1 is the highest priority.ms-outlook xp sends the following headers if you set it to 'high':X-Priority: 1 (Highest)X-MSMail-Priority: HighImportance: High
|
|
$sensitivity |
|
private string $sensitivity
>><<
the email sensitivity.
only sent if it is set.one of 'personal', normal privat vertraulich
|
|
$_attachment |
|
private array $_attachment
>><<
vector
|
| See Also |
$this |
|
$_header |
|
private array $_header
>><<
hash holding additional key/value pairs to attach to the mail header.
note that all the vars like '_from', '_to' etc are all headers too. sodon't add them here again. it would result in an error message from theserver because most header lines can't be sent twice.special case: there may be a key called '_noKey' which holds a vector withplain header lines to attach. example $_header value:$_header['MIME-Version'] = '1.0';$_header['X-Mimeole'] = 'Produced By Microsoft MimeOLE V4.72.2106.4';$_header['_noKey'][0] = 'X-Msmail-Priority: Normal';
|
| See Also |
$this |
|
$encoding |
|
private string $encoding
>>'7bit'<<
|
|
$this |
|
private unknown $this
>><<
|
|
|
Private Constant Details |
BS_SMTP_VERSION
define( BS_SMTP_VERSION, >>4.0.$x$<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR
define( BS_MAIL_ERROR, >>1<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_SYNTAX
define( BS_MAIL_ERROR_SYNTAX, >>2<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_HOST
define( BS_MAIL_ERROR_HOST, >>3<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_NO_SUCH_USER
define( BS_MAIL_ERROR_NO_SUCH_USER, >>4<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_NEW_ADDRESS
define( BS_MAIL_ERROR_NEW_ADDRESS, >>5<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_COMMUNICATION
define( BS_MAIL_ERROR_COMMUNICATION, >>6<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_NOT_CAPABLE
define( BS_MAIL_ERROR_NOT_CAPABLE, >>7<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_NEED_MORE_DATA
define( BS_MAIL_ERROR_NEED_MORE_DATA, >>8<< )
Case: default: case sensitive
|
|
BS_MAIL_ERROR_NOT_CONNECTED
define( BS_MAIL_ERROR_NOT_CONNECTED, >>9<< )
Case: default: case sensitive
|
|
BS_EMAILVALIDATOR_WARNING_NEW_ADDRESS
define( BS_EMAILVALIDATOR_WARNING_NEW_ADDRESS, >>1000<< )
Case: default: case sensitive
|
|
|
|
|
|
| PHPDoc 1.0beta |