Login   Register  
PHP Classes
elePHPant
Icontem

bulkmail with smtp fails

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      MIME E-mail message sending  >  All threads  >  bulkmail with smtp fails  >  (Un) Subscribe thread alerts  
Subject:bulkmail with smtp fails
Summary:bulkmail with smtp fails after error
Messages:2
Author:Helge Orthmann
Date:2013-01-23 12:29:24
Update:2013-01-24 16:05:16
 

  1. bulkmail with smtp fails   Reply   Report abuse  
Picture of Helge Orthmann
Helge Orthmann
2013-01-23 12:29:24
Hi,

i want to sent a bulk mail with smtp, but after i got an error with $email_message->Send() all following $email_message->Send() has the same error message.
For example :
3 emails:
test@-online.de
test@test.de
test2@test.de

With the following (shorted) code i always got following error message:
501 <test@-online.de>: domain missing or malformed
501 <test@-online.de>: domain missing or malformed
501 <test@-online.de>: domain missing or malformed

What can i do?
I've tested StopSendigMessage and ResetConnection but this dosen't help


include("email_message.php");
/* sende über smtp */
include("smtp_message.php");
include("mime/smtp.php");
include("mime/sasl.php");
$email_message=new smtp_message_class;
$email_message->localhost="localhost";
$email_message->smtp_host=$SMTPDATEN['host'];
/* smtp_direct_delivery muss auf 0, da sonst nach jeder Mail eine Connection aufgebaut wird und der smtp Server irgendwann keine Mails mehr annimmt */
$email_message->smtp_direct_delivery=0;
$email_message->smtp_exclude_address="";
/* wenn smtp_direct_delivery auf 1, dann keine Userdaten */
$email_message->smtp_user=$SMTPDATEN['user'];
$email_message->smtp_password=$SMTPDATEN['password'];
$email_message->smtp_port=$SMTPDATEN['port'];
$email_message->smtp_ssl=0;
/* tls muss aus, sonst funktioniert der Aufruf über exec nicht */
$email_message->smtp_start_tls=0;
$email_message->smtp_debug=0;
$email_message->smtp_html_debug=1;
$email_message->maximum_bulk_deliveries=$SMTPDATEN['maximum_bulk_deliveries'];

/* setze Standard Vars */
$email_message->SetBulkMail(1);
$email_message->mailer="gradwerk CMS4 Newsletter";
$email_message->default_charset="UTF-8";
/* personalisierte newsletter, daher kein cache auf body */
$email_message->cache_body=0;

$from_address = $BEREICH["Absender_Email"];
$from_name = $BEREICH["Absender_Name"];
$reply_name = $from_name;
$reply_address = $from_address;
$error_delivery_name = $from_name;
$subject = $SEND["Betreff"];
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name);
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name);
$email_message->SetHeader("Sender",$from_address);
if(defined("PHP_OS") && strcmp(substr(PHP_OS,0,3),"WIN")){
if(phpversion()>="4.2.3" && ini_get("safe_mode")=="1") {}
else $email_message->SetHeader("Return-Path",$error_delivery_address);
}
$email_message->SetEncodedHeader("Subject",$subject);

$text_message = $replaced_text;
$text_message = preg_replace("/(\r\n|\n|\r)/", "\n", $text_message);
$email_message->CreateQuotedPrintableTextPart($text_message,"",$text_part);
$email_message->AddPart($text_part);


while($ABONNENTEN = mysql_fetch_array($RES_ABONNENTEN)) {
$replacedtext = $replaced_text;
$replacedhtml = $replaced_html;
$email_message->SetEncodedEmailHeader("To",$ABONNENTEN["Email"],'');

$text_message = $replacedtext;
$text_message = preg_replace("/(\r\n|\n|\r)/", "\n", $text_message);
$email_message->CreateQuotedPrintableTextPart($text_message,"",$text_part_recipe);
$email_message->ReplacePart($text_part,$text_part_recipe);

$error=$email_message->Send();
if($error) {
/* what can i do? */



}

}

  2. Re: bulkmail with smtp fails   Reply   Report abuse  
Picture of Helge Orthmann
Helge Orthmann
2013-01-24 16:05:16 - In reply to message 1 from Helge Orthmann
Ok, found the answer in an older thread