Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include 'Mail.php';
- $host = 'smtp.ok.pt';
- $from = 'quem@ola.pt';
- $username = 'ehehe';
- $password = 'fkfkjf';
- $to = 'bla@cospelonge.pt';
- $cc = 'maisum@bolas.pt,outro@bolas.pt';
- $bcc = 'ai@chatice.pt';
- $body = 'teste';
- $body = utf8_decode($body);
- $subject = utf8_decode('c\'est lavie en rose');
- $crlf = "\n";
- $recipients = $to . ", " . $cc . ", " . $bcc;
- $headers = array('From' => $from, 'To' => $to, 'Cc' => $cc, 'Bcc' => $bcc, 'Subject' => $subject);
- $smtp = Mail::factory('smtp',array('host' => $host,
- 'port' => 465, // SMTPS
- 'auth' => true,'debug' => true,
- 'username' => $username,
- 'password' => $password)
- );
- $mail = $smtp->send($recipients, $headers, $body);
- if (PEAR::isError($mail)) {
- error_log($mail->getMessage());
- } else {
- echo "Enviado com sucesso";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement