是否有像* .oft这样的电子邮件模板文件,可以在所有电子邮件程序中打开?

Currently I'm writing a web interface which is full of data. I would like to export this data as an e-mail template, so you can edit the e-mail afterwards. Is there a format such as *.oft, which can be read by all email programs?

I know that there is such a function in HTML (<a href="mailto:[...]">). Since the e-mail text is very long and I want to attach files, this doesn't seems to be a good solution.

Can someone help me?

There's no such format as you're looking for. The internet engineers who design email protocols and format concern themselves with what goes out over the network, but not with what's internal to the machine. Email is highly interoperable when sending and receiving messages as a result, but there's no analogous standards body for internal API's. Sometimes there are de facto standards that arise from a imitating the behavior of popular piece of software, but that hasn't happened for the email feature you're looking for.

Maybe you mean .EML files? I remember that this file can be opened with nearly all e-mail clients such as Outlook, Thunderbird etc.

As far as I can tell you can go one of two ways:

1 - Use a prebuilt solution such as the one by these guys at postageapp.com their API looks pretty simple and does everything you want to achieve.

2 - More time consuming, but you can create your own templete using PHP. I would go for something along these lines. This is a very simple way of doing it. You could write your own CSS in the head and go nuts. Just remember that tables are king when it comes to HTML email :) Once the template has been written, you could just pass through the $content to fill it....

sender.php

<?php

        $email = "Hello, 
";
        $email.= "Very <strong>impressed</strong> with your email! 

";
        $email.= "Faithfully
";
        $email.= "Mr Example
";

        $to = "me@me.me"; // <-- Set this as yours for testing...

        $from = "someone@nice.me";
        $subject = "An email";
        $headers = "From: Someone nice <" . $from . ">
";
        $headers .= "Reply-To: ". $from . "
";
        $headers .= "MIME-Version: 1.0
";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1
";
        $message = '<html><body>';
        $message .= nl2br($email); // <---- if your email contains newline characters - it will convert them to <br />
        $message .= '<br /><a href="http://www.example.com" target="_blank">www.example.com</a>';   
        $message .= "</body></html>";
        mail($to, $subject, $message, $headers);    
            // ADD LOTS OF PROTECTION IF NOT HARD CODING :)
?>

To extend this - if you for example use Gmail, then you could use Google's SMTP to send it - so that the email wouldn't say 'Sent on behalf of'.

Just create a email using HTML without CSS. Any data or binary can be passed through PHP and then emailed to the recipient.

To get you started, Create a file using fopen();. PHP has other functions that would allow you to edit, open, search&replace and even convert a file to a format of your choice. This is equivalent to a .oft file if not better, because all emails are be sent in text or a html equivalent regardless of the email client.

If you'd would like some more info on how to create this, let me know.