![Picture of Oleg Peters Picture of Oleg Peters](/graphics/unknown.gif)
Oleg Peters - 2007-01-24 16:40:47
Hello! Please help me, I get the message using mime message with smtp, sasl and smarty: not possible to send e-mail message
my code:
include_once('includes/mimeMessage/email_message.php');
include_once('includes/mimeMessage/smtp.php');
include_once('includes/mimeMessage/smtp_message.php');
include_once('includes/mimeMessage/sasl.php');
$email_message=new email_message_class;
include('includes/smtp_settings.php');
$from_name=getenv("Oleg");
$from_address="olegpeters@gmx.de";
$reply_name=$from_name;
$reply_address=$from_address;
$reply_address=$from_address;
$error_delivery_name=$from_name;
$error_delivery_address=$from_address;
$to=olegpeters@gmx.de;
$subject="Testing the html mail";
$email_message->SetBulkMail(1);
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name);
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name);
$email_message->SetEncodedHeader("Subject",$subject);
$email_message->cache_body=0;
//Smarty
$mail_smarty=new Smarty;
$mail_smarty->assign("subject",HtmlEntities($subject));
$mail_smarty->assign("fromname",HtmlEntities($from_name));
$mail_smarty->assign("firstname","");
$mail_smarty->assign("balance","0");
$mail_smarty->assign("email","?");
$html_message=$mail_smarty->fetch('themes/theme1/emailer/reg_mail.html.tpl');
$email_message->AddQuotedPrintableHTMLPart($html_message,"");
$error=$email_message->Send();
$email_message->SetBulkMail(0);
if(strlen($error))echo "Error: $error\n";
The settings in smtp_settings.php work with the example test_smtp_message.php