Jump to content

emailing sav files, wont work?


Pezmc

Recommended Posts

Mailing sav files wont work but when I change the extension of the file to .txt it does work.

 

See Below Script:

//Attachment version of message
		$extension=explode (".", file.sav); 
		$countdot=count($extension)-1;
		$extension=$extension[$countdot];
		$headers .= "--{$boundary}\r\n" .
			"Content-Type: application/octet-stream\r\n" .
			"Content-Transfer-Encoding: base64\r\n" .
			"Content-Disposition: attachment; filename="file.sav"\r\n";
		$headers .= chunk_split(base64_encode(file_get_contents('backup/file.sav)));
		$headers .= "\r\n --{$boundary}--";
}

if (!mail("geoff@googlemail.com", "Test", "", $headers)) { 
	$erreur++; $erreurmsg.='There was a problem sending your email please try again.<br>'; 
}	

(As part of bigger script that deals with all the headers etc...)

 

 

The above script sends a email to the email address, I can pick it up. Gmail shows the clip logo (attachment), but when I view the actual email no attached files are shown. However if I change this line:

"Content-Disposition: attachment; filename="file.sav"\r\n";

to this:

"Content-Disposition: attachment; filename="file.txt"\r\n";

the entire script works and I recieve the file but as a txt.

 

Does anyone have any idea how I can get sav files to be mailed. I have tried sending them using gmail (it works fine) and reading the mime but it is exactly the same as mine.

 

Please tell me whats wrong!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.