PHP Classes

Not possible to send e-mail message

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  Not possible to send e-mail message  >  (Un) Subscribe thread alerts  
Subject:Not possible to send e-mail message
Summary:Error: not possible to send e-mail message
Messages:3
Author:Oleg Peters
Date:2007-01-24 16:40:47
Update:2007-01-25 08:50:55
 

  1. Not possible to send e-mail message   Reply   Report abuse  
Picture of Oleg Peters 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

  2. Re: Not possible to send e-mail message   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-01-25 00:32:47 - In reply to message 1 from Oleg Peters
You are using the email_message_class object, so it attempts to send the message using the mail() function, which is failing for some reason.

You need to use the smtp_message_class object instead. Take a look at the test_smtp_message.php script to see how the smtp_message_class should be used.


  3. Re: Not possible to send e-mail message   Reply   Report abuse  
Picture of Oleg Peters Oleg Peters - 2007-01-25 08:50:55 - In reply to message 2 from Manuel Lemos
Thank you very much, it works now