Currently, i am working on one project related to x-cart. and what i found is there is no any functionality regarding add attachment to the email. I want to attach one pdf with mail. and I didn't found any solution regarding this. is there any facilities regarding this in x-cart. or is it already in but I am not aware of it?
untill i know x-cart allows two types of mail sending. you can send simple mail using php mailer with attachment. don't use xcart's personal mail system. i have faced it too. and made solution with php mailer. xcart have no any free modules to send mail with attachments.
I guess you need to email PDF invoices to buyers.
I googled this: https://help.x-cart.com/index.php?title=X-Cart:X-PDF_Invoices https://market.x-cart.com/addons/PDF-Invoice.html
There are a few PDF libraries out there that output to email format. I just used one in a project not so long ago. I used TCPDF. If you can get a library to output a header and content array in email format, then you can add it straight to X-Cart's content array. Otherwise create an $output['header']
and $output['content']
and use that. Remember, it needs to be in the correct email content format. You can't just give it a filename in the above arrays.
Generating the output is fairly straight forward for this library.
$output = $PDF->Output('filename.pdf', 'EX');
In func.mail.php
before...
list($message_header, $mail_message) = func_parse_mail($msgs);
you would want to add your output there.
// Add the attachment
$msgs['content'][] = $output;
list($message_header, $mail_message) = func_parse_mail($msgs);