0

how to set the headers of my mail function php to accept both the user input information in a html format and the attachement the problem is when i set the headers of my function of both html and attachement format it does not accept her is my code below

 $headers = "MIME-Version: 1.0\r\n"; 
 $headers.= "From: EITA\r\n";
 $headers.= "Reply-To: EITA" . "\r\n";
 $headers.= "MIME-Version: 1.0" . $passage_ligne;
 $headers.= 'Content-type: text/html; charset=iso-8859-1 \r\n';
 $headers.= 'Content-Type: multipart/mixed; boundary='.$boundary .' '. 
 $passage_ligne;
Safa Jwd
  • 19
  • 6
  • _Suggestion:_ Instead of using PHP's low level mail-function, use one of the tried and tested mail libraries instead, like PHPMailer or SwiftMail or similar. That would make your coding life a lot easier. – M. Eriksson May 24 '18 at 10:56
  • i agree with you but is not me who make the decision ... i have only make the code works – Safa Jwd May 24 '18 at 11:08
  • Can't you just include the library? I won't tell if you don't ;-) Here's a question with a similar query: https://stackoverflow.com/questions/9519588/send-php-html-mail-with-attachments Check if that answer sheds any light on your issue. – M. Eriksson May 24 '18 at 11:11

0 Answers0