Jump to content

1.6.1.24 (and 1.7?) no attachment in Windows 10 Mail


karstenboldt

Recommended Posts

Hi,

upgrading a 1.6.1.4 to 1.6.1.24 I had to change an override the Mail.php:

1.6.1.4:

class Mail extends MailCore
{
  public static function Send($id_lang, $template, $subject, $template_vars, $to,
        $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
        $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null, $reply_to = null)
  {
    if(strpos($template,'order_conf') !== false && file_exists(_PS_THEME_DIR_.'/mailtexte/agb.pdf')){      
          $file_attachment[] = 
          array(
            'content' =>  new Swift_File(_PS_THEME_DIR_.'/mailtexte/agb.pdf'),
            'mime'    =>  'application/pdf',
            'name'    =>  'Agb.pdf'
          );
    };

1.6.1.24:

    public static function Send($id_lang, $template, $subject, $template_vars, $to,
        $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
        $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null, $reply_to = null)
    {
    if(strpos($template,'order_conf') !== false && file_exists(_PS_THEME_DIR_.'mailtexte/agb.pdf')){
          $file_attachment[] = 
          array(
            'content' =>  file_get_contents(_PS_THEME_DIR_.'mailtexte/agb.pdf'),
            'mime'    =>  'application/pdf',
            'name'    =>  'Agb.pdf'
          );
    };

The new code seems to work. I can find my attachment in the order confirmation mail.

However, the (standard) mail from Windows 10 does not display the attachment (Outlook, webmailer, ... do!) ?
It seems if there is something broken with the newer version of swiftmailer creating mails (with attachments) which do not work with windows mail !?
Can anyone confirm the problem is or is not in 1.7 ?


Do you have any ideas what I can try?
Can 

thanks and best regards,

Karsten

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...