I tried it but it don't work ...
When I specify a return-path address as "
[email protected]", the MAIL FROM smtp command take this address : MAIL FROM:
[email protected]
but my $from_address variable is
[email protected] ...
I think it's because on your smtp_message class, in SendMessageHeaders() function, you write that :
[code]
if(!$this->smtp->MailFrom(count($return_path) ? Key($return_path) : Key($from)))
return($this->ResetConnection($this->smtp->error));
...
[/code]
So I changed this line with :
[code]
if(!$this->smtp->MailFrom(key($from)))
return($this->ResetConnection($this->smtp->error));
...
[/code]
And with this modification, MAIL FROM is good : MAIL FROM:
[email protected]
But now, the return path is equal to the MAIL FROM ...
return-path:
[email protected]
I think it's a bug or a configuration problem.
Here is my configuration :
[code]
$from_name=$this->senderName;
$from_address=$this->sender;
$reply_name=$from_name;
$reply_address=$this->replyTo;
$error_delivery_name=$from_name;
$error_delivery_address=$this->returnPath;
$to_name="";
$to_address=$this->to;
$subject=$this->subject;
$message=$this->message;
[/code]
And the header construct part :
[code]
$email_message->SetEncodedEmailHeader("To",$to_address,$to_name, 'UTF-8');
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name, 'UTF-8');
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name, 'UTF-8');
$email_message->SetHeader("Return-Path",$error_delivery_address);
//$email_message->SetEncodedEmailHeader("Errors-To",$error_delivery_address,$error_delivery_name);
$email_message->SetEncodedHeader("Subject",$subject);
$email_message->CreateQuotedPrintableHTMLPart($this->message,'UTF-8',$html_part);
$email_message->CreateQuotedPrintableTextPart($email_message->WrapText(VALIDATION_SUBSCRIPTION_BODY_TEXT),"",$text_part);
$alternative_parts=array($text_part,$html_part);
$email_message->CreateAlternativeMultipart($alternative_parts,$alternative_part);
$email_message->AddAlternativeMultipart($alternative_parts);
$error=$email_message->Send();
[/code]
Thank you very much for your help Manuel.
Regards,
Cedric