Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Mail / Transport / SmtpOptions.php
blob795c3fb947c7c9b330b01516bd831ad3cf893eb7
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Mail\Transport;
12 use Zend\Mail\Exception;
13 use Zend\Stdlib\AbstractOptions;
15 class SmtpOptions extends AbstractOptions
17 /**
18 * @var string Local client hostname
20 protected $name = 'localhost';
22 /**
23 * @var string
25 protected $connectionClass = 'smtp';
27 /**
28 * Connection configuration (passed to the underlying Protocol class)
30 * @var array
32 protected $connectionConfig = array();
34 /**
35 * @var string Remote SMTP hostname or IP
37 protected $host = '127.0.0.1';
39 /**
40 * @var int
42 protected $port = 25;
44 /**
45 * Return the local client hostname
47 * @return string
49 public function getName()
51 return $this->name;
54 /**
55 * Set the local client hostname or IP
57 * @todo hostname/IP validation
58 * @param string $name
59 * @throws \Zend\Mail\Exception\InvalidArgumentException
60 * @return SmtpOptions
62 public function setName($name)
64 if (!is_string($name) && $name !== null) {
65 throw new Exception\InvalidArgumentException(sprintf(
66 'Name must be a string or null; argument of type "%s" provided',
67 (is_object($name) ? get_class($name) : gettype($name))
68 ));
70 $this->name = $name;
71 return $this;
74 /**
75 * Get connection class
77 * This should be either the class Zend\Mail\Protocol\Smtp or a class
78 * extending it -- typically a class in the Zend\Mail\Protocol\Smtp\Auth
79 * namespace.
81 * @return string
83 public function getConnectionClass()
85 return $this->connectionClass;
88 /**
89 * Set connection class
91 * @param string $connectionClass the value to be set
92 * @throws \Zend\Mail\Exception\InvalidArgumentException
93 * @return SmtpOptions
95 public function setConnectionClass($connectionClass)
97 if (!is_string($connectionClass) && $connectionClass !== null) {
98 throw new Exception\InvalidArgumentException(sprintf(
99 'Connection class must be a string or null; argument of type "%s" provided',
100 (is_object($connectionClass) ? get_class($connectionClass) : gettype($connectionClass))
103 $this->connectionClass = $connectionClass;
104 return $this;
108 * Get connection configuration array
110 * @return array
112 public function getConnectionConfig()
114 return $this->connectionConfig;
118 * Set connection configuration array
120 * @param array $connectionConfig
121 * @return SmtpOptions
123 public function setConnectionConfig(array $connectionConfig)
125 $this->connectionConfig = $connectionConfig;
126 return $this;
130 * Get the host name
132 * @return string
134 public function getHost()
136 return $this->host;
140 * Set the SMTP host
142 * @todo hostname/IP validation
143 * @param string $host
144 * @return SmtpOptions
146 public function setHost($host)
148 $this->host = (string) $host;
149 return $this;
153 * Get the port the SMTP server runs on
155 * @return int
157 public function getPort()
159 return $this->port;
163 * Set the port the SMTP server runs on
165 * @param int $port
166 * @throws \Zend\Mail\Exception\InvalidArgumentException
167 * @return SmtpOptions
169 public function setPort($port)
171 $port = (int) $port;
172 if ($port < 1) {
173 throw new Exception\InvalidArgumentException(sprintf(
174 'Port must be greater than 1; received "%d"',
175 $port
178 $this->port = $port;
179 return $this;