Return to Snippet

Revision: 32795
at December 15, 2011 18:38 by mikael12


Updated Code
require_once PATH . '/include/phpmailer/class.phpmailer.php';

$html_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <html>
              <head>
              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />     
              <!-- Facebook sharing information tags -->
              <meta property="og:title" content="EMAIL_SUBJECT" />       
              <title>EMAIL_SUBJECT</title>
              </head>
	      <body>MAIL_TEXT</body>
	      </html>';

$text_body = 'MAIL_TEXT';

$mailer              = new PHPMailer();
$mailer->From        = 'FROM_EMAIL';
$mailer->FromName    = 'FROM_NAME';
$mailer->Subject     = 'SUBJECT';
$mailer->ContentType = 'text/html';
$mailer->CharSet     = 'utf-8';
$mailer->Priority    = 2;
$mailer->Body        = $html_body;
$mailer->AltBody     = $text_body;
$mailer->IsHTML(true);
$mailer->AddAddress(TO_EMAIL);
$mailer->AddReplyTo('REPLY_TO_EMAIL');
$mailer->AddAttachment('FILE_PATH', 'FILE_NAME');

if ($mailer->Send()) {
	echo 'Mail sent';
} else {
	echo 'Mail error';
}

Revision: 32794
at December 15, 2011 18:36 by mikael12


Updated Code
require_once PATH . '/include/phpmailer/class.phpmailer.php';

$html_body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />     
        <!-- Facebook sharing information tags -->
        <meta property="og:title" content="EMAIL_SUBJECT" />
        
        <title>EMAIL_SUBJECT</title>
		<body>Mail_text</body>
	</html>';

$text_body = 'Mail_text';

$mailer              = new PHPMailer();
$mailer->From        = 'FROM_EMAIL';
$mailer->FromName    = 'FROM_NAME';
$mailer->Subject     = 'SUBJECT';
$mailer->ContentType = 'text/html';
$mailer->CharSet     = 'utf-8';
$mailer->Priority    = 2;
$mailer->Body        = $html_body;
$mailer->AltBody     = $text_body;
$mailer->IsHTML(true);
$mailer->AddAddress(TO_EMAIL);
$mailer->AddReplyTo('REPLY_TO_EMAIL');
$mailer->AddAttachment('FILE_PATH', 'FILE_NAME');

if ($mailer->Send()) {
	echo 'Mail sent';
} else {
	echo 'Mail error';
}

Revision: 32793
at December 15, 2011 18:31 by mikael12


Updated Code
require_once PATH . '/include/phpmailer/class.phpmailer.php';

$html_body = '<html><head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
		<body>Mail_text</body>
	</html>';

$text_body = 'Mail_text';

$mailer              = new PHPMailer();
$mailer->From        = 'FROM_EMAIL';
$mailer->FromName    = 'FROM_NAME';
$mailer->Subject     = 'SUBJECT';
$mailer->ContentType = 'text/html';
$mailer->CharSet     = 'utf-8';
$mailer->Priority    = 2;
$mailer->Body        = $html_body;
$mailer->AltBody     = $text_body;
$mailer->IsHTML(true);
$mailer->AddAddress(TO_EMAIL);
$mailer->AddReplyTo('REPLY_TO_EMAIL');
$mailer->AddAttachment('FILE_PATH', 'FILE_NAME');

if ($mailer->Send()) {
	echo 'Mail sent';
} else {
	echo 'Mail error';
}

Revision: 32792
at November 22, 2011 03:49 by mikael12


Updated Code
require_once PATH . '/include/phpmailer/class.phpmailer.php';

$html_body = '<html><head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
		<body>Mail_text</body>
	</html>';

$text_body = 'Mail_text';

$mailer                 = new PHPMailer();
$mailer->From        = 'FROM_EMAIL';
$mailer->FromName    = 'FROM_NAME';
$mailer->Subject     = 'SUBJECT';
$mailer->ContentType = 'text/html';
$mailer->CharSet     = 'utf-8';
$mailer->Priority    = 2;
$mailer->Body        = $html_body;
$mailer->AltBody     = $text_body;
$mailer->IsHTML(true);
$mailer->AddAddress(TO_EMAIL);
$mailer->AddReplyTo('REPLY_TO_EMAIL');
$mailer->AddAttachment('FILE_PATH', 'FILE_NAME');

if ($mailer->Send()) {
	echo 'Mail sent';
} else {
	echo 'Mail error';
}

Revision: 32791
at October 27, 2011 21:25 by mikael12


Updated Code
require_once PATH . '/include/phpmailer/class.phpmailer.php';

$html_body = '<html><head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
		<body>Mail_text</body>
	</html>';

$text_body = 'Mail_text';

$mailer              = new PHPMailer();
$mailer->From        = '[email protected]';
$mailer->FromName    = 'From_name';
$mailer->Subject     = 'Subject';
$mailer->ContentType = 'text/html';
$mailer->CharSet     = 'utf-8';
$mailer->Priority    = 2;
$mailer->Body        = $html_body;
$mailer->AltBody     = $text_body;
$mailer->IsHTML(true);
$mailer->AddAddress($email);
$mailer->AddAttachment('file_path', 'file_name');

if ($mailer->Send())
	echo 'Mail sent';
else
	echo 'Mail error';

Revision: 32790
at January 26, 2011 22:54 by mikael12


Updated Code
require_once PATH . '/include/phpmailer/class.phpmailer.php';

$mailer = new PHPMailer();
$mailer->From = '[email protected]';
$mailer->FromName = 'From_name';
$mailer->Subject = 'Subject';
$mailer->AddAddress($email);
$mailer->ContentType = 'text/html';
$mailer->CharSet = 'utf-8';
$mailer->Priority = 2;
$mailer->AddAttachment('file_path', 'file_name');
$mailer->Body = '<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>Mail_text</body></html>';

if ($mailer->Send())
	echo 'Mail sent';
else
	echo 'Mail error';

Revision: 32789
at October 2, 2010 05:57 by mikael12


Initial Code
require 'include/phpmailer/class.phpmailer.php';

$mailer = new PHPMailer();
$mailer->From = '[email protected]';
$mailer->FromName = 'From_name';
$mailer->Subject = 'Subject';
$mailer->AddAddress($email);
$mailer->ContentType = 'text/html';
$mailer->CharSet = 'utf-8';
$mailer->Priority = 2;
$mailer->AddAttachment('file_path', 'file_name');
$mailer->Body = '<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>Mail_text</body></html>';

if ($mailer->Send())
	echo 'Mail sent';
else
	echo 'Mail error';

Initial URL
http://phpmailer.worxware.com/

Initial Description
http://phpmailer.worxware.com/index.php?pg=methods

Initial Title
Send mail + attachment with PHPmailer

Initial Tags

                                

Initial Language
PHP