Welcome Guest, Not a member yet? Register   Sign In
i am trying to pass variables with the subject in the send mail
#1

[eluser]dinisptc[/eluser]
i am trying to pass variables with the subject in the send mail

Code:
function send_mail($dist_list,$report_file,$reply_to,$name_of_project_manager,$date_meeting,$report_name) {
   $this->load->library( 'email' );
   $this->email->from($reply_to,$name_of_project_manager);
   $this->email->to($dist_list);
   $this->email->reply_to($reply_to);
  
   //this does not work
   //$this->email->subject('Report construction '.$report_name.' from '.$date_meeting.' by on');
  
  
   $this->email->subject('Report construction by on');
  
   $data=array();  
   $message = $this->load->view('reports_sendmail_tpl/send_report.tpl.php',$data,TRUE);

    $this->email->message($message);
  
  
  
  
  
   $this->email->attach($report_file);
   $this->email->send();
}


//$this->email->subject('Report construction '.$report_name.' from '.$date_meeting.' by on');

this line gives an error and its not sending the email
#2

[eluser]CroNiX[/eluser]
What's the error? Have you verified that $report_name and $date_meeting are being received by that function and contain data?
#3

[eluser]dinisptc[/eluser]
yes the variables contain data

$date_meeting = 2013-12-12 00:00:00
and
$report_name = MaisonduLac-03-12-2013.pdf

i am going to check the error
#4

[eluser]dinisptc[/eluser]
these are the errors

A PHP Error was encountered

Severity: Notice

Message: fwrite(): send of 8192 bytes failed with errno=104 Connection reset by peer

Filename: libraries/Email.php

Line Number: 1846
A PHP Error was encountered

Severity: Notice

Message: fwrite(): send of 3 bytes failed with errno=32 Broken pipe

Filename: libraries/Email.php

Line Number: 1846
#5

[eluser]dinisptc[/eluser]


this was the report name
MaisonduLac-03-12-2013.pdf


$repo=str_replace('-','',$report_name);

Report construction MaisonduLac03122013.pdf by on

like this its working

but with the date its always crashing

$originalDate = $date_meeting;

$newDate = date("dmY", strtotime($originalDate));

//$repo_Date=str_replace('-','',$newDate);

$repo_Date=$newDate;

removed the - from the date but its still crashing on email library




Theme © iAndrew 2016 - Forum software by © MyBB