/    Sign up×
Community /Pin to ProfileBookmark

emailing sav files, wont work?

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

See Below Script:

[code=php]//Attachment version of message
$extension=explode (“.”, file.sav);
$countdot=count($extension)-1;
$extension=$extension[$countdot];
$headers .= “–{$boundary}rn” .
“Content-Type: application/octet-streamrn” .
“Content-Transfer-Encoding: base64rn” .
“Content-Disposition: attachment; filename=”file.sav”rn”;
$headers .= chunk_split(base64_encode(file_get_contents(‘backup/file.sav)));
$headers .= “rn –{$boundary}–“;
}

if (!mail(“[email protected]”, “Test”, “”, $headers)) {
$erreur++; $erreurmsg.=’There was a problem sending your email please try again.<br>’;
} [/code]

(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:

[code=php]“Content-Disposition: attachment; filename=”file.sav”rn”;[/code]

to this:

[code=php]“Content-Disposition: attachment; filename=”file.txt”rn”;[/code]

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!

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Pezmc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...