Swiftmailer, attach VCard
===

I am using swiftmailer to send a vcard, but when I open the vcf file in mail it doesnt work.

Before I used custom php code instead of swiftmailer and that worked.

    	
    function makeVcard() {
    
    	global $vcard_content, $v_type, $v_first, $v_middle, $v_last, $v_nick, $v_company, $v_title, $v_email, $v_web, $v_street;
    	global $v_city, $v_state, $v_zip, $v_country, $v_phone, $v_cell, $v_fax, $v_note, $formfirst;
    	
    	if ($v_type=="company") { $vt="WORK"; }
    	else { $vt="HOME"; }
    		
    	$vcard_content  = "BEGIN:VCARD\r";
    	$vcard_content .= "VERSION:3.0\r";
    	$vcard_content .= "N:".$v_last.";".$v_first.";".$v_middle.";;\r";
    	if ($v_type=="company") { $vcard_content .= "FN:".$v_company."\r"; }
    	else { $vcard_content .= "FN:".$v_first." ".$v_middle." ".$v_last."\r"; }
    	$vcard_content .= "NICKNAME:".$v_nick."\r";
    	$vcard_content .= "ORG:".$v_company.";\r";
    	$vcard_content .= "TITLE:".$v_title."\r";
    	$vcard_content .= "EMAIL;type=INTERNET;type=".$vt.";type=pref:".$v_email."\r";
    	$vcard_content .= "TEL;type=".$vt.";type=pref:".$v_phone."\r";
    	$vcard_content .= "TEL;type=CELL:".$v_cell."\r";
    	$vcard_content .= "TEL;type=".$vt.";type=FAX:".$v_fax."\r";
    	$vcard_content .= "item1.ADR;type=".$vt.";type=pref:;;".$v_street.";".$v_city.";".$v_state.";".$v_zip.";".$v_country."\r";
    	$vcard_content .= "item1.X-ABADR:us\r";
    	$vcard_content .= "item2.URL;type=pref:".$v_web."\r";
    	$vcard_content .= "item2.X-ABLabel:_$!<HomePage>!\$\_\r";
    	$vcard_content .= "NOTE:".$v_note."\r";
    	if ($v_type=="company") { $vcard_content .= "X-ABShowAs:COMPANY\r"; }
    	$vcard_content .= "END:VCARD";
    }
    
        $attachment2 = Swift_Attachment::newInstance()
          ->setFilename('My_Name.vcf')
          ->setContentType('text/x-vcard')
          ->setBody(chunk_split(base64_encode(makeVcard())))
          ->setEncoder(Swift_Encoding::getBase64Encoding());
        
        	$message = Swift_Message::newInstance()
        
          	// Give the message a subject
          ->setSubject('Your subject')
        
          // Set the From address with an associative array
          ->setFrom(array('dsfs@sdf.com' => My Name'))
        
          // Set the To addresses with an associative array
          ->setTo(array($tomail => 'Beste'))
        
          // Give it a body
          ->setBody($str, 'text/html')
        
          // Attach it to the message
          ->attach($attachment)
        
          ->attach($attachment2);
        
          $mailer->send($message);

Can anyone help me out please