1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| function Send() {
$header = "";
$body = "";
if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)
{
$this->SetError($this->Lang("provide_address"));
sent_mail = false;
}
// Set whether the message is multipart/alternative
if(!empty($this->AltBody))
$this->ContentType = "multipart/alternative";
$this->SetMessageType();
$header .= $this->CreateHeader();
$body = $this->CreateBody();
if($body == "") { sent_mail = false; }
// Choose the mailer
if($this->Mailer == "sendmail")
{
if(!$this->SendmailSend($header, $body))
sent_mail = false;
}
elseif($this->Mailer == "mail")
{
if(!$this->MailSend($header, $body))
sent_mail = false;
}
elseif($this->Mailer == "smtp")
{
if(!$this->SmtpSend($header, $body))
sent_mail = false;
}
else
{
$this->SetError($this->Mailer . $this->Lang("mailer_not_supported"));
sent_mail = false;
}
return sent_mail ;
} |
Partager