| include('Mail/mime.php'); |
| function send_mail(string $email, object $smtp, object $message) { |
| 'Subject' => $message->subject |
| $smtp = Mail::factory('smtp', array( |
| 'username' => $smtp->username, //your gmail account |
| 'password' => $smtp->password // your password |
| // Creating the Mime message |
| $mime = new Mail_mime($crlf); |
| // Setting the body of the email |
| $mime->setTXTBody($message->text); |
| $mime->setHTMLBody($message->html); |
| $headers = $mime->headers($headers); |
| $mail = $smtp->send($email, $headers, $body); |
| if (PEAR::isError($mail)) { |
| /* send_mail("mattf@tilde.club", $SMTP, (object) [ */ |
| /* "subject" => "Please confirm your email", */ |
| /* "text" => "Plain tet", */ |
| /* "html" => "<html><body><p>HTML message</p><h2>This is not mere text</h2></body></html>" */ |