Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once "Mail.php";
- require_once "Mail/mime.php";
- $message = new Mail_mime();
- $html = "Hello <strong>world</strong> !";
- $message->setHTMLBody($html);
- $body = $message->get();
- $extraheaders = array("From"=>"Votre nom <votre@gmail.com>",
- "Subject"=>"Sujet du mail",
- "To"=>"Nom destinataire <destinataire@exemple.com>");
- $headers = $message->headers($extraheaders);
- $host = "ssl://smtp.gmail.com";
- $port = "465";
- $username = "votre_login_gmail";
- $password = "votre_password_gmail";
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'port' => $port,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
- $mail = $smtp->send("destinataire@exemple.com", $headers, $body);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement