Parse error
HejJeg har følgende fil:
<?php
class mails {
private $date = date('D, j M Y H:i:s O'); <- Line 3
private $receiver = 'martin@spicyweb.dk';
private $to = '';
private $from_mail = ''; // Mandatory
private $from_name = ''; // Mandatory
private $mime_version = '1.0'; // Mandatory
private $content_type = 'text/html'; // Mandatory
private $charset = 'utf-8'; // Mandatory
private $subject = ''; // Mandatory
private $message_in_text = ''; // Mandatory
private $message_in_html = ''; // Mandatory
private $reply_to = ''; // Hvem der modtager et evt. svar på mailen
private $return_path = ''; // Næsten det samme som $reply_to, men nogle e-mail klienter kræver denne, andre laver en default/standard
private $cc = ''; // Carbon copy
private $bcc = ''; // Blind carbon copy
private $boundary_string = '==Multipart_Boundary_x{' . md5(time()) . '}x';
private $x_mailer_php = 'PHP ' . phpversion();
private $content_transfer_encoding = '7bit';
private $attachments = '';
private $composed_message = '';
private $composed_headers = '';
public function __construct ($receiver = '') {
if($receiver != '') {
$this->receiver = $receiver;
}
}
public function setReceiver($receiver)
{
$this->receiver = $receiver;
}
public function setTo($to)
{
$this->to = $to;
}
public function setMimeVersion($mimetype)
{
$this->mime_type = $mimetype;
}
public function setContentType($contenttype)
{
$this->content_type = $contenttype;
}
public function setCharset($charset)
{
$this->charset = $charset;
}
public function setSubject($subject)
{
$this->subject = $subject;
}
public function setMessage($message)
{
$this->message = $message;
}
public function setSender($mail, $name = '')
{
$this->from_mail = $mail;
if($name != '') {
$this->from_name = $name;
}
}
public function setReplyTo($replyto)
{
$this->reply_to = $replyto;
}
public function setReturnPath($returnpath)
{
$this->return_path = $returnpath;
}
public function setCC($cc)
{
$this->cc = $cc;
}
public function setBCC($bcc)
{
$this->bcc = $bcc;
}
public function setContentTransferEncoding($encoding)
{
$this->content_transfer_encoding = $encoding;
}
public function composeMessage($mail_content)
{
if($this->attachments == '') {
} else {
return false; // Ikke implementeret
}
}
public function composeHeaders()
{
if($this->mime_version != '' && $this->from != '' && $this->content_type != '') {
$this->composed_headers = "Date: " . $this->date . "\n";
if($this->from_name != '') {
$this->composed_headers .= "From: " . $this->from_name . "<" . $this->from . ">\n";
} else {
$this->composed_headers .= "From: " . $this->from;
}
if($this->cc != '') {
$this->composed_headers .= "cc: " . $this->cc;
}
$this->composed_headers .= "Content-Type: " . $this->content_type . ";";
} else {
return false;
}
}
public function sendHTMLMail()
{
}
public function sendPlainTextMail()
{
}
public function sendMultipartMail($attachments = false)
{
if($attachments != true) {
$this->composed_headers .= "\n";
$this->composed_headers .= " boundary=\"{$this->boundary_string}\"";
if($this->composed_message == '') {
$this->composed_message .= "This is a multi-part message in MIME format.\n\n";
}
// Creating the text/plain message
$this->composed_message .= "--{$this->boundary_string}\n";
$this->composed_message .= "Content-Type: text/plain; charset=\"$this->charset\"\n";
$this->composed_message .= "Content-Transfer-Encoding: $this->content_transfer_encoding\n\n";
$this->composed_message .= $this->message_in_text . "\n\n";
// Creating the text/html message
$this->composed_message .= "--{$this->boundary_string}\n";
$this->composed_message .= "Content-Type: text/html; charset=\"$this->charset\"\n";
$this->composed_message .= "Content-Transfer-Encoding: $this->content_transfer_encoding\n\n";
$this->composed_message .= $this->message_in_html . "\n\n";
// Finishing the message
$this->composed_message .= "--{$this->boundary_string}--\n";
if(mail($this->receiver, $this->subject, $this->composed_message, $this->composed_headers)) {
return true;
} else {
return false;
}
} else {
return false; // Ikke implementeret
}
}
}
?>
hvor jeg får følgende fejl, som jeg simpelthen ikke kan lure:
Parse error: parse error, expecting `','' or `';'' in D:\wamp\www\investeringsauktionen.dk\includes\classes\class.mails.php on line 3
Line 3 her jeg lige hurtigt markeret. Kan I se fejlen, for jeg har stirret mig blind nu :)
