Location: PHPKode > projects > EXtensible Production Suite (XPS) > xpsdev/helpers/xpm3/EXAMPLES/mail.php
<?php

/***************************************************************************************
 *                                                                                     *
 * This file is part of the XPertMailer package (http://xpertmailer.sourceforge.net/)  *
 *                                                                                     *
 * XPertMailer is free software; you can redistribute it and/or modify it under the    *
 * terms of the GNU General Public License as published by the Free Software           *
 * Foundation; either version 2 of the License, or (at your option) any later version. *
 *                                                                                     *
 * XPertMailer is distributed in the hope that it will be useful, but WITHOUT ANY      *
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A     *
 * PARTICULAR PURPOSE.  See the GNU General Public License for more details.           *
 *                                                                                     *
 * You should have received a copy of the GNU General Public License along with        *
 * XPertMailer; if not, write to the Free Software Foundation, Inc., 51 Franklin St,   *
 * Fifth Floor, Boston, MA  02110-1301  USA                                            *
 *                                                                                     *
 * XPertMailer SMTP & POP3 PHP Mail Client. Can send and read messages in MIME Format. *
 * Copyright (C) 2006  Tanase Laurentiu Iulian                                         *
 *                                                                                     *
 ***************************************************************************************/

/**
 Send an e-mail using a Relay SMTP Mail Server (Gmail on port 465 via SSL)
 - text message
 - html message
 - attachment inline (XPertMailer logo image)
 - print debug message
*/

require_once '../XPM3_MAIL.php';

$file = 'xpertmailer.gif';
$id = XPM3_MIME::unique($file);

$m = new XPM3_MAIL;
//$m->Host('localhost', $mx);
$m->Relay('smtp.gmail.com', 'hide@address.com', 'password', 465, true) or die('Can\'t connect to Relay SMTP Mail Server !'); // or print_r($m->result);
$m->Delivery('relay');
$m->From('hide@address.com', 'My Name');
$m->AddTo('hide@address.com', 'Client Name');
$m->Text('It is simple to use XPM3'."\n\n".'Powered by XPertMailer');
$m->Html('It is simple to use <b>XPM3</b><br><br><i>Powered by</i> <img src="cid:'.$id.'">');
$m->AttachFile($file, '', 'new-name.gif', '', 'base64', 'inline', $id);
$m->Send('Hello World!');
$m->Quit(); // quit from relay smtp server
print_r($m->result);

?>
Return current item: EXtensible Production Suite (XPS)