EOL
EOL
End of line string for an SMTP server
A small class for communicating with an SMTP server. Used to avoid configuration issues that might be needed with PHP's built-in mail() function. Here is an example of how one might use this class:
$server = new MailServer('somewhere.com', 587, 'someone', 'pword', 'tls'); $to = "cool@place.com"; $from = "someone@somewhere.com"; $subject = "Test Mail"; $message = "This is a test"; $server->send($subject, $from, $to, $message);
__construct(string $sender_email, string $server, integer $port, string $login, string $password, mixed $secure = false)
Encapuslates the domain and credentials of a SMTP server in a MailServer object
string | $sender_email | who mail will be sent from (can be overwritten) |
string | $server | domain name of machine will connect to |
integer | $port | port on that machine |
string | $login | username to use for authentication ("" if no auth) |
string | $password | password to use for authentication ("" if no auth) |
mixed | $secure | false is SSL and TLS not used, otherwise SSL or TLS |
send(string $subject, string $from, string $to, string $message)
Sends (or queues for media updater) an email (much like PHP's mail command, but not requiring a configured smtp server on the current machine)
string | $subject | subject line of the email |
string | $from | sender email address |
string | $to | recipient email address |
string | $message | message body for the email |
sendImmediate(string $subject, string $from, string $to, string $message)
Sends immediately an email (as opposed to queueing for a future process to send)
string | $subject | subject line of the email |
string | $from | sender email address |
string | $to | recipient email address |
string | $message | message body for the email |