<?php
/*--------------------------------------------------------- 
 * File:email.php
 * Author:Tomix
 * Description: 
 * Created:2009
 * -------------------------------------------------------
 * Modified history:2023/08/22
 * Copyright © 2023 蘋果世界股份有限公司 版權所有
 * -------------------------------------------------------
 */
class email {
    public string $toAddress;
    public string $fromAddress;
    public string $replyToAddress;
    public string $subject;
    public string $content;

    public string $MIMEVersion = "1.0";
    public string $contentType = "text/html;charset=utf-8";

    public function send(): bool {
        $headers = "MIME-Version: " . $this->MIMEVersion . "\r\n";
        $headers .= "Content-type: " . $this->contentType . "\r\n";
        $headers .= "From: " . $this->fromAddress . "\r\n";
        $headers .= "Reply-To: " . $this->replyToAddress . "\r\n";

        return mail($this->toAddress, $this->subject, $this->content, $headers);
    }
}
?>